thanks to Koen, a memory leak were fond and fixed here.
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Sat, 28 Feb 2009 06:12:06 +0000 (06:12 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Sat, 28 Feb 2009 06:12:06 +0000 (06:12 +0000)
When the flag is force-overwrite and replace files.
opkg will not free the root_filename well.

git-svn-id: http://opkg.googlecode.com/svn/trunk@202 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_install.c

index a60b75f03d8ecae1ee36504304ebc7f48e7d96d7..f9bf732af2f817f0a815125cf646695561554f5f 100644 (file)
@@ -1306,12 +1306,17 @@ static int check_data_file_clashes_change(opkg_conf_t *conf, pkg_t *pkg, pkg_t *
      str_list_t *files_list;
      str_list_elt_t *iter;
 
+     char *root_filename = NULL;
+
      int clashes = 0;
 
      files_list = pkg_get_installed_files(pkg);
      for (iter = str_list_first(files_list); iter; iter = str_list_next(files_list, iter)) {
-         char *root_filename;
          char *filename = (char *) iter->data;
+          if (root_filename) {
+              free(root_filename);
+              root_filename = NULL;
+          }
          root_filename = root_filename_alloc(conf, filename);
          if (file_exists(root_filename) && (! file_is_dir(root_filename))) {
               pkg_t *owner;
@@ -1336,7 +1341,10 @@ static int check_data_file_clashes_change(opkg_conf_t *conf, pkg_t *pkg, pkg_t *
               }
 
          }
-         free(root_filename);
+     }
+     if (root_filename) {
+         free(root_filename);
+         root_filename = NULL;
      }
      pkg_free_installed_files(pkg);