opkg: (leak fixing, day 3) fixed final memory leaks fixed reported from
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 05:19:00 +0000 (05:19 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 05:19:00 +0000 (05:19 +0000)
running libopkg_test

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

libbb/unarchive.c
libopkg/pkg_depends.c
libopkg/pkg_hash.c

index 5fc5725e06114fa67f54e48b58d3947e0c9b8846..4e3a2edc04463b75e88cf86ca3535f17c39f7059 100644 (file)
@@ -755,6 +755,8 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
                                output_buffer = unarchive(uncompressed_stream, out_stream, get_header_tar, free_header_tar, extract_function, prefix, file_list);
                        }
                        seek_sub_file(deb_stream, ar_header->size);
+                       free (ar_header->name);
+                       free (ar_header);
                }
                gz_close(gunzip_pid);
                fclose(deb_stream);
index f6e3827e2429b97cdadf01c9fd2f4ddde89433fc..bc2ac27886a19686ea318b8c43b8624e2b8773b9 100644 (file)
@@ -372,6 +372,7 @@ int version_constraints_satisfied(depend_t * depends, pkg_t * pkg)
 
     comparison = pkg_compare_versions(pkg, temp);
 
+    free (temp->version);
     free(temp);
 
     if((depends->constraint == EARLIER) && 
@@ -661,6 +662,8 @@ int buildProvides(hash_table_t * hash, abstract_pkg_t * ab_pkg, pkg_t * pkg)
 
     if (!pkg->provides_count)
       return 0;
+    if (pkg->provides)
+      return 0;
 
     pkg->provides = (abstract_pkg_t **)malloc(sizeof(abstract_pkg_t *) * (pkg->provides_count + 1));
     if (pkg->provides == NULL) {
index f38c6cada4e89c5399f108b5427d2f06f0219d4c..2fb0d1d8bf4a44639816f11a057ed449326aa73f 100644 (file)
@@ -140,6 +140,7 @@ int pkg_hash_add_from_file(opkg_conf_t *conf, const char *file_name,
               }
               hash_insert_pkg(hash, pkg, is_status_file,conf);
          } else {
+              pkg_deinit (pkg);
               free(pkg);
          }
      }