Hi, there is the original patch indeed it is not this.
Kindest regards. On 21 December 2016 at 14:17, Vadim Pakhnushev <vadim.pakhnus...@oracle.com> wrote: > Abhijit, > I think there's some misunderstanding here. > The pointer you are trying to free is NULL already: > > if ( newFontPath == NULL ) { > free ( ( void *) appendDirList ); > + free((void*) newFontPath); > > Thanks, > Vadim > > > On 21.12.2016 16:02, Abhijit Roy wrote: > > Hi all, > > > > > > > > Please review the fix for the bug below: > > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8171836 > > > > Description: Memory leak in java.desktop/unix/native/common/awt/fontpath.c > > > > Webrev: http://cr.openjdk.java.net/~rpatil/8171836/webrev.00/ > > > > > > To prevent memory leak issue, I have released the newFontPath in > java.desktop/unix/native/common/awt/fontpath. > > Moving forward it for review. > > > > > > > > Regards, > > > > Abhijit > > > >
diff --git a/src/java.desktop/unix/native/common/awt/fontpath.c b/src/java.desktop/unix/native/common/awt/fontpath.c --- a/src/java.desktop/unix/native/common/awt/fontpath.c +++ b/src/java.desktop/unix/native/common/awt/fontpath.c @@ -289,6 +289,7 @@ onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, strlen (fDirP->name[index]) + 2, sizeof( char ) ); if (onePath == NULL) { free ( ( void *) appendDirList ); + free ( ( void *) newFontPath ); XFreeFontPath ( origFontPath ); return; }