Fix a memory leak 90/184090/2
authorSangyoon Jang <jeremy.jang@samsung.com>
Fri, 13 Jul 2018 07:54:33 +0000 (16:54 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 16 Jul 2018 09:12:21 +0000 (09:12 +0000)
Change-Id: I4737d0f91b4a3ae07be45bae79e2df1a11030348
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
(cherry picked from commit bdc9f8cc28086444358249acfdf243be9862a54b)

client/src/pkgmgr.c

index d7e48cc..6273ebb 100644 (file)
@@ -1699,11 +1699,13 @@ API int pkgmgr_client_usr_clear_cache_dir(const char *pkgid, uid_t uid)
                        g_variant_new("(us)", uid, pkgid), &result);
        if (ret != PKGMGR_R_OK) {
                ERR("request failed: %d", ret);
+               pkgmgr_client_free(client);
                return ret;
        }
 
        g_variant_get(result, "(i)", &ret);
        g_variant_unref(result);
+       pkgmgr_client_free(client);
 
        return ret;
 }