OpenJDK / amber / amber
changeset 43318:86da43ee6364
8171836: Memory leak in java.desktop/unix/native/common/awt/fontpath.c
Reviewed-by: prr, arapte
Contributed-by: David Carlier <devnexen@gmail.com>
author | prr |
---|---|
date | Fri, 20 Jan 2017 16:03:08 -0800 |
parents | cbe67e782fce |
children | 66a889959081 |
files | jdk/src/java.desktop/unix/native/common/awt/fontpath.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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; }