Fix to wrong free filter list
[platform/core/appfw/pkgmgr-info.git] / src / pkgmgrinfo_private.c
index 3948953..1ace1b5 100644 (file)
@@ -27,7 +27,6 @@
 #include <dlfcn.h>
 
 #include <vconf.h>
-#include <sqlite3.h>
 #include <glib.h>
 #include <unzip.h>
 
@@ -587,16 +586,14 @@ API char *__get_type_from_path(const char *pkg_path)
        return strdup(type);
 }
 
-static const char *__get_library_path(const char *pkg_type)
+static void __get_library_path(const char *pkg_type, const char **path)
 {
        char buf[64];
-       const char *path;
 
        snprintf(buf, sizeof(buf), "package-manager/backendlib/lib%s.so",
                        pkg_type);
-       path = tzplatform_mkpath(TZ_SYS_RO_ETC, buf);
 
-       return path;
+       *path = tzplatform_mkpath(TZ_SYS_RO_ETC, buf);
 }
 
 API pkg_plugin_set *__load_library(const char *pkg_type)
@@ -606,7 +603,7 @@ API pkg_plugin_set *__load_library(const char *pkg_type)
        bool (*on_load)(pkg_plugin_set *plugin);
        const char *library_path;
 
-       library_path = __get_library_path(pkg_type);
+       __get_library_path(pkg_type, &library_path);
        if (library_path == NULL) {
                _LOGE("cannot get library path for %s", pkg_type);
                return NULL;