Fix memory leak 28/113728/1
authorHyunho Kang <hhstark.kang@samsung.com>
Wed, 8 Feb 2017 12:25:55 +0000 (21:25 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Wed, 8 Feb 2017 12:26:27 +0000 (21:26 +0900)
Change-Id: I3745bd700358c9435138cd73be5fa42b959164e0
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
src/message-port.c

index 98074a9..e7b2bfc 100755 (executable)
@@ -715,6 +715,8 @@ message_port_pkt_s *__message_port_recv_raw(int fd)
 
        if (__read_string_from_socket(fd, (char **)&pkt->data, &pkt->data_len) != MESSAGEPORT_ERROR_NONE) {
                LOGE("read socket fail: data");
+               if (pkt->data)
+                       free(pkt->data);
                free(pkt->remote_port_name);
                free(pkt);
                return NULL;