JDK-8001585 : realloc is used naively in the native code
  • Type: Bug
  • Component: other-libs
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2012-10-25
  • Updated: 2013-03-20
  • Resolved: 2013-03-20
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Description
The realloc() procedure is often used to increase a memory allocation that is associated with a pointer. If realloc() fails it returns the value "NULL". 

When one makes the call:

myPointer = realloc(myPointer, desiredAllocationSize); 

and realloc fails, then myPointer points to NULL, and any memory that it previously pointed to is lost.


line number 275 of
jdk/src/solaris/native/java/lang/java_props_macosx.c

line number 1205 of:
jdk/src/solaris/native/sun/awt/multiVis.c

line number 282 of:
jdk/src/solaris/native/sun/tools/attach/SolarisVirtualMachine.c