opkg: (leak fixing, day 2) lots and lots of memory leaks fixed
[oweals/opkg-lede.git] / libopkg / opkg_install.c
index 883f559fe0b21674d23984a5b39436c0db7fa354..f6666b20db17d4d8367f44e04f781671a761bc33 100644 (file)
@@ -1,4 +1,4 @@
-/* opkg_install.c - the itsy package management system
+/* opkg_install.c - the opkg package management system
 
    Carl D. Worth
 
@@ -15,7 +15,7 @@
    General Public License for more details.
 */
 
-#include "opkg.h"
+#include "includes.h"
 #include <errno.h>
 #include <dirent.h>
 #include <glob.h>
@@ -35,6 +35,7 @@ typedef void (*sighandler_t)(int);
 #include "opkg_utils.h"
 #include "opkg_message.h"
 #include "opkg_state.h"
+#include "opkg_defines.h"
 
 #include "sprintf_alloc.h"
 #include "file_util.h"
@@ -393,6 +394,7 @@ int satisfy_dependencies_for(opkg_conf_t *conf, pkg_t *pkg)
      }
 
      if (ndepends <= 0) {
+         pkg_vec_free(depends);
          return 0;
      }
 
@@ -965,7 +967,7 @@ int opkg_install_pkg(opkg_conf_t *conf, pkg_t *pkg, int from_upgrade)
               signal(SIGINT, old_handler);
          else
               sigprocmask(SIG_UNBLOCK, &newset, &oldset);
-
+          pkg_vec_free (replacees);
          return 0;
      
 
@@ -995,6 +997,7 @@ int opkg_install_pkg(opkg_conf_t *conf, pkg_t *pkg, int from_upgrade)
          else
               sigprocmask(SIG_UNBLOCK, &newset, &oldset);
 
+          pkg_vec_free (replacees);
          return err;
      }
      opkg_set_current_state (conf, OPKG_STATE_NONE, NULL);