#include "pkgmgrinfo_debug.h"
#include "pkgmgr-info.h"
-static void __free_packages(gpointer data)
+static void __free_packages(gpointer key, gpointer value,
+ gpointer user_data)
{
- pkgmgrinfo_basic_free_package((package_x *)data);
+ pkgmgrinfo_basic_free_package((package_x *)value);
}
static const char join_localized_info[] =
}
list = g_hash_table_new_full(g_str_hash, g_str_equal, NULL,
- __free_packages);
+ NULL);
if (list == NULL)
return PMINFO_R_ERROR;
PMINFO_PKGINFO_GET_ALL, list);
if (ret != PMINFO_R_OK) {
+ g_hash_table_foreach_remove(list, __free_packages, NULL);
g_hash_table_destroy(list);
- return PMINFO_R_ERROR;
+ return ret;
}
*pkginfo_list = list;