The return value of realloc must be checked to determine if the reallocation succeeded. The pointer to the original memory must be stored so that in the event that realloc fails, then the original memory can be freed.
Also the return value of malloc (and calloc) must be checked for failure.
The following files are effected:
src/share/native/sun/security/jgss/wrapper/GSSLibStub.c
src/share/native/sun/security/jgss/wrapper/NativeUtil.c
src/share/native/sun/security/smartcardio/pcsc.c
src/solaris/native/com/sun/security/auth/module/Solaris.c
src/solaris/native/com/sun/security/auth/module/Unix.c