summaryrefslogtreecommitdiffstats
path: root/libopkg/pkg_hash.c
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:26:51 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:26:51 (EST)
commitb70dc315e405d3c59dae2a795462f85d02cbb8df (patch)
tree32bd52b0db1901e262e637dc3f2f93e746a38df6 /libopkg/pkg_hash.c
parent6b7a2a530a5fdd990264466882528c9db8c6ae0b (diff)
opkg: fix the crashing issue.
It's a hanging pointer. Using installed_files without get and free git-svn-id: http://opkg.googlecode.com/svn/trunk@144 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/pkg_hash.c')
-rw-r--r--libopkg/pkg_hash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
index 97613e5..c63847b 100644
--- a/libopkg/pkg_hash.c
+++ b/libopkg/pkg_hash.c
@@ -648,10 +648,13 @@ int file_hash_set_file_owner(opkg_conf_t *conf, const char *file_name, pkg_t *ow
// opkg_message(conf, OPKG_DEBUG2, "owning_pkg=%s filename=%s\n", owning_pkg->name, file_name);
hash_table_insert(file_hash, file_name, owning_pkg);
if (old_owning_pkg) {
+ pkg_get_installed_files(old_owning_pkg);
str_list_remove_elt(old_owning_pkg->installed_files, file_name);
+ pkg_free_installed_files(old_owning_pkg);
/* mark this package to have its filelist written */
old_owning_pkg->state_flag |= SF_FILELIST_CHANGED;
owning_pkg->state_flag |= SF_FILELIST_CHANGED;
+
}
return 0;
}