opkg: (leak fixing, day 3) fixed final memory leaks fixed reported from
[oweals/opkg-lede.git] / libopkg / pkg_depends.c
index f6e3827..bc2ac27 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) {