# HG changeset patch # User prr # Date 1484956988 28800 # Node ID 86da43ee63647465613f0fec0906cd18efdd34e5 # Parent cbe67e782fceec4c57781620f8a00dbf31416ece 8171836: Memory leak in java.desktop/unix/native/common/awt/fontpath.c Reviewed-by: prr, arapte Contributed-by: David Carlier diff -r cbe67e782fce -r 86da43ee6364 jdk/src/java.desktop/unix/native/common/awt/fontpath.c --- a/jdk/src/java.desktop/unix/native/common/awt/fontpath.c Fri Jan 20 15:13:48 2017 -0800 +++ b/jdk/src/java.desktop/unix/native/common/awt/fontpath.c Fri Jan 20 16:03:08 2017 -0800 @@ -289,6 +289,12 @@ onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, strlen (fDirP->name[index]) + 2, sizeof( char ) ); if (onePath == NULL) { free ( ( void *) appendDirList ); + + for ( index = origIndex; index < nPaths; index++ ) { + free( newFontPath[index] ); + } + + free( ( void *) newFontPath); XFreeFontPath ( origFontPath ); return; }