opkg: consolidate error enums and add an error for when no package matches
[oweals/opkg-lede.git] / libopkg / opkg_upgrade.c
index c8b3f1925d7ea89034de4bb0b6260686966e1d38..ed2fc3a9701d45121992846eb0bc430085d5836a 100644 (file)
@@ -1,4 +1,4 @@
-/* opkg_upgrade.c - the itsy package management system
+/* opkg_upgrade.c - the opkg package management system
 
    Carl D. Worth
    Copyright (C) 2001 University of Southern California
@@ -33,7 +33,7 @@ int opkg_upgrade_pkg(opkg_conf_t *conf, pkg_t *old)
           return 0;
      }
 
-     new = pkg_hash_fetch_best_installation_candidate_by_name(conf, old->name);
+     new = pkg_hash_fetch_best_installation_candidate_by_name(conf, old->name, NULL);
      if (new == NULL) {
           old_version = pkg_version_str_alloc(old);
           opkg_message(conf, OPKG_NOTICE,
@@ -72,6 +72,8 @@ int opkg_upgrade_pkg(opkg_conf_t *conf, pkg_t *old)
           old->state_want = SW_DEINSTALL;
      }
 
+    free(old_version);
+    free(new_version);
      new->state_flag |= SF_USER;
      return opkg_install_pkg(conf, new,1);
 }