From 8fe2c7a40a79c7d1b68bd00955729e94a21a0ea5 Mon Sep 17 00:00:00 2001 From: graham.gower Date: Fri, 30 Oct 2009 02:37:09 -0400 Subject: Fix some memory leaks. git-svn-id: http://opkg.googlecode.com/svn/trunk@229 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg/pkg_hash.c') diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c index 5b7e3dd..dc9c3d0 100644 --- a/libopkg/pkg_hash.c +++ b/libopkg/pkg_hash.c @@ -576,10 +576,6 @@ pkg_t *hash_insert_pkg(hash_table_t *hash, pkg_t *pkg, int set_status,opkg_conf_ if(!ab_pkg->pkgs) ab_pkg->pkgs = pkg_vec_alloc(); - /* pkg_vec_insert_merge might munge package, but it returns an unmunged pkg */ - pkg = pkg_vec_insert_merge(ab_pkg->pkgs, pkg, set_status,conf ); - pkg->parent = ab_pkg; - if (buildProvides(hash, ab_pkg, pkg)<0){ fprintf(stderr, "%s : This should never happen. Report this Bug in bugzilla please \n ",__FUNCTION__); return NULL; @@ -595,6 +591,11 @@ pkg_t *hash_insert_pkg(hash_table_t *hash, pkg_t *pkg, int set_status,opkg_conf_ } buildDependedUponBy(pkg, ab_pkg); + + /* pkg_vec_insert_merge might munge package, but it returns an unmunged pkg */ + pkg = pkg_vec_insert_merge(ab_pkg->pkgs, pkg, set_status,conf ); + pkg->parent = ab_pkg; + return pkg; } -- cgit v0.9.1