r4558 - trunk/src/target/opkg/libopkg

tick at docs.openmoko.org tick at docs.openmoko.org
Sun Jul 27 17:05:04 CEST 2008


Author: tick
Date: 2008-07-27 17:05:01 +0200 (Sun, 27 Jul 2008)
New Revision: 4558

Modified:
   trunk/src/target/opkg/libopkg/opkg_install.c
   trunk/src/target/opkg/libopkg/pkg.c
   trunk/src/target/opkg/libopkg/pkg_extract.c
Log:
opkg: balance the installed_files reference count
      reducing some memory leaks


Modified: trunk/src/target/opkg/libopkg/opkg_install.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_install.c	2008-07-27 06:42:19 UTC (rev 4557)
+++ trunk/src/target/opkg/libopkg/opkg_install.c	2008-07-27 15:05:01 UTC (rev 4558)
@@ -506,7 +506,9 @@
 		    hash_table_insert(&conf->obs_file_hash, old_file, old_pkg);
 	       }
 	  }
+          pkg_free_installed_files(old_pkg);
      }
+     pkg_free_installed_files(new_pkg);
      return 0;
 }
 

Modified: trunk/src/target/opkg/libopkg/pkg.c
===================================================================
--- trunk/src/target/opkg/libopkg/pkg.c	2008-07-27 06:42:19 UTC (rev 4557)
+++ trunk/src/target/opkg/libopkg/pkg.c	2008-07-27 15:05:01 UTC (rev 4558)
@@ -1737,6 +1737,7 @@
 	       // opkg_message(conf, OPKG_DEBUG2, "pkg %s: file=%s\n", pkg->name, installed_file);
 	       file_hash_set_file_owner(conf, installed_file, pkg);
 	  }
+	  pkg_free_installed_files(pkg);
      }
      pkg_vec_free(installed_pkgs);
 

Modified: trunk/src/target/opkg/libopkg/pkg_extract.c
===================================================================
--- trunk/src/target/opkg/libopkg/pkg_extract.c	2008-07-27 06:42:19 UTC (rev 4557)
+++ trunk/src/target/opkg/libopkg/pkg_extract.c	2008-07-27 15:05:01 UTC (rev 4558)
@@ -136,6 +136,8 @@
 	       } else {
 		    fputs(data_file, file);
 	       }
+	       free(line);
+	       line=NULL;
 	  }
      }
      fclose(tmp);





More information about the commitlog mailing list