changeset 4452:bad3bed4b323

8006006: [parfait] Memory leak at hotspot/src/share/tools/launcher/wildcard.c Summary: a simple fix to add FileList_free(fl) before returning NULL. Reviewed-by: zgu, coleenp, minqi
author ccheung
date Fri, 29 Mar 2013 14:18:40 -0700
parents 8554c55669b0
children 17bf4d428955
files src/share/tools/launcher/wildcard.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/tools/launcher/wildcard.c	Thu Apr 04 08:47:39 2013 -0400
+++ b/src/share/tools/launcher/wildcard.c	Fri Mar 29 14:18:40 2013 -0700
@@ -368,8 +368,10 @@
     const char *basename;
     FileList fl = FileList_new(16);
     WildcardIterator it = WildcardIterator_for(wildcard);
-    if (it == NULL)
+    if (it == NULL) {
+        FileList_free(fl);
         return NULL;
+    }
     while ((basename = WildcardIterator_next(it)) != NULL)
         if (isJarFileName(basename))
             FileList_add(fl, wildcardConcat(wildcard, basename));