r4392 - trunk/src/target/opkg/libbb

thomas at sita.openmoko.org thomas at sita.openmoko.org
Wed Apr 23 14:17:51 CEST 2008


Author: thomas
Date: 2008-04-23 14:17:49 +0200 (Wed, 23 Apr 2008)
New Revision: 4392

Modified:
   trunk/src/target/opkg/libbb/unarchive.c
   trunk/src/target/opkg/libbb/unzip.c
Log:
opkg: fix some initialisation and double free issues in libbb


Modified: trunk/src/target/opkg/libbb/unarchive.c
===================================================================
--- trunk/src/target/opkg/libbb/unarchive.c	2008-04-23 09:53:44 UTC (rev 4391)
+++ trunk/src/target/opkg/libbb/unarchive.c	2008-04-23 12:17:49 UTC (rev 4392)
@@ -715,7 +715,7 @@
 	char *output_buffer = NULL;
 	char *ared_file = NULL;
 	char ar_magic[8];
-	int gunzip_pid;
+	int gunzip_pid = 0;
 
 	if (filename != NULL) {
 		file_list = xmalloc(sizeof(char *) * 2);

Modified: trunk/src/target/opkg/libbb/unzip.c
===================================================================
--- trunk/src/target/opkg/libbb/unzip.c	2008-04-23 09:53:44 UTC (rev 4391)
+++ trunk/src/target/opkg/libbb/unzip.c	2008-04-23 12:17:49 UTC (rev 4392)
@@ -71,7 +71,7 @@
 
 /* these are freed by gz_close */
 static unsigned char *window;
-static unsigned long *crc_table;
+static unsigned long *crc_table = NULL;
 
 static unsigned long crc; /* shift register contents */
 
@@ -1020,6 +1020,9 @@
 	free(window);
 	free(crc_table);
 
+	window = NULL;
+	crc_table = NULL;
+
 	return exit_code;
 }
 





More information about the commitlog mailing list