From 6afed21188df0c417349563621302ec85f44096f Mon Sep 17 00:00:00 2001 From: graham.gower Date: Thu, 26 Nov 2009 19:42:00 -0500 Subject: Provide error checking for users of pkg_extract_* functions. git-svn-id: http://opkg.googlecode.com/svn/trunk@391 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg/opkg_remove.c') diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c index f744585..f53ef00 100644 --- a/libopkg/opkg_remove.c +++ b/libopkg/opkg_remove.c @@ -329,8 +329,14 @@ remove_data_files_and_list(opkg_conf_t *conf, pkg_t *pkg) pkg_t *owner; int rootdirlen = 0; - str_list_init(&installed_dirs); installed_files = pkg_get_installed_files(conf, pkg); + if (installed_files == NULL) { + opkg_message(conf, OPKG_ERROR, "Failed to determine installed " + "files for %s. None removed.\n", pkg->name); + return; + } + + str_list_init(&installed_dirs); /* don't include trailing slash */ if (conf->offline_root) -- cgit v0.9.1