Bug 1245441 - [Coverity 220566] Free a pointer, r=kaie
authorPaul Bignier <paul.bignier@gmail.com>
Fri, 05 Feb 2016 22:52:04 +0100
changeset 11861 9448cd7cf830621d609d0955570ed88e001aad7e
parent 11860 027d796daad2a84a540e4c7db77ec5ede1da5851
child 11862 313155f1077bac87d574b0529247904ecb604f54
push id970
push userkaie@kuix.de
push dateFri, 05 Feb 2016 21:56:17 +0000
reviewerskaie
bugs1245441, 220566
Bug 1245441 - [Coverity 220566] Free a pointer, r=kaie
lib/jar/jarfile.c
--- a/lib/jar/jarfile.c
+++ b/lib/jar/jarfile.c
@@ -657,17 +657,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;
@@ -801,16 +801,18 @@ jar_listzip(JAR *jar, JAR_FILE fp)
 	    err = JAR_ERR_CORRUPT;
 	    goto loser;
 	}
     }
 
 loser:
     if (Local) 
     	PORT_Free(Local);
+    if (phy)
+    	PORT_Free(phy);
     if (Central) 
     	PORT_Free(Central);
     if (End) 
     	PORT_Free(End);
     return err;
 }
 
 /*