Bug 1245441 - Free a pointer, r=franziskus
authorPaul Bignier <paul.bignier@gmail.com>
Tue, 15 Mar 2016 01:35:00 +0100
changeset 12004 7208817c1958e31f8ddc90dd9719956829aa44a3
parent 12003 25197240d8011c3619e5c5748dbd18e6a4f93d74
child 12005 05148b61d15a1d2c24c63b64c34cffcfce0ca46a
push id1073
push userfranziskuskiefer@gmail.com
push dateTue, 15 Mar 2016 14:17:38 +0000
reviewersfranziskus
bugs1245441
Bug 1245441 - Free a pointer, r=franziskus
lib/jar/jarfile.c
--- a/lib/jar/jarfile.c
+++ b/lib/jar/jarfile.c
@@ -653,17 +653,17 @@ jar_gen_index(JAR *jar, jarArch format, 
  *  style .ZIP file into the JAR linked list.
  *
  */
 static int
 jar_listzip(JAR *jar, JAR_FILE fp)
 {
     ZZLink *ent;
     JAR_Item *it;
-    JAR_Physical *phy;
+    JAR_Physical *phy = NULL;
     struct ZipLocal *Local = PORT_ZNew(struct ZipLocal);
     struct ZipCentral *Central = PORT_ZNew(struct ZipCentral);
     struct ZipEnd *End = PORT_ZNew(struct ZipEnd);
 
     int err = 0;
     long pos = 0L;
     unsigned int compression;
     unsigned int filename_len, extra_len;
@@ -797,16 +797,18 @@ jar_listzip(JAR *jar, JAR_FILE fp)
             err = JAR_ERR_CORRUPT;
             goto loser;
         }
     }
 
 loser:
     if (Local)
         PORT_Free(Local);
+    if (phy && it == NULL)
+        PORT_Free(phy);
     if (Central)
         PORT_Free(Central);
     if (End)
         PORT_Free(End);
     return err;
 }
 
 /*