Fix memory leaks
[platform/core/appfw/pkgmgr-server.git] / src / request.c
index ee0bfae..e625e2b 100644 (file)
@@ -1097,11 +1097,13 @@ static int __handle_request_cleardata(uid_t caller_uid,
                                pkgtype, pkgid, NULL)) {
                g_dbus_method_invocation_return_value(invocation,
                                g_variant_new("(i)", PKGMGR_R_ESYSTEM));
+               free(pkgtype);
                return -1;
        }
 
        g_dbus_method_invocation_return_value(invocation,
                        g_variant_new("(i)", PKGMGR_R_OK));
+       free(pkgtype);
 
        return 0;
 }
@@ -1134,11 +1136,13 @@ static int __handle_request_clearcache(uid_t caller_uid,
                                pkgtype,  pkgid, NULL)) {
                g_dbus_method_invocation_return_value(invocation,
                                g_variant_new("(i)", PKGMGR_R_ESYSTEM));
+               free(pkgtype);
                return -1;
        }
 
        g_dbus_method_invocation_return_value(invocation,
                        g_variant_new("(i)", PKGMGR_R_OK));
+       free(pkgtype);
 
        return 0;
 }