Bug 1245441 - [Coverity 220566] Free a pointer, r=kaie
--- 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;
}
/*