Fix a memory leak 71/94271/1
authorSangyoon Jang <s89.jang@samsung.com>
Fri, 28 Oct 2016 02:23:30 +0000 (11:23 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Fri, 28 Oct 2016 02:23:30 +0000 (11:23 +0900)
Change-Id: I82da1edb86120c3c778e8247b451729f0e7451e1
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
installer/pkgmgr_installer.c

index c039757..b9d8c59 100644 (file)
@@ -261,14 +261,14 @@ static int __send_signal_for_event_for_uid(pkgmgr_installer *pi, uid_t uid,
        memcpy(ptr, name, name_size);
        ptr += name_size;
        memcpy(ptr, gv_data, gv_len);
+       g_free(gv_data);
 
        if (__send_signal_to_agent(uid, data, data_len)) {
                ERR("failed to send signal to agent");
-               g_free(data);
+               free(data);
                return -1;
        }
 
-       g_free(gv_data);
        free(data);
 
        return 0;