From: Dmitry Bogatov Date: Fri, 31 Jan 2014 07:32:42 +0000 (+0400) Subject: Memory leak in error branch X-Git-Tag: Tizen_SDK_2.3~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee97824beea2557650f2b9fba89c97b83c3a1445;p=platform%2Fcore%2Fsystem%2Fswap-manager.git Memory leak in error branch Change-Id: I9df22010dc8498fa522a2b6b32a61fdf40117b8e Signed-off-by: Dmitry Bogatov --- diff --git a/daemon/daemon.c b/daemon/daemon.c index 7da1871..af1490c 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -729,8 +729,10 @@ static int controlSocketHandler(int efd) // Receive payload (if exists) recv_len = recv(manager.host.control_socket, msg->payload, msg->len, MSG_WAITALL); - if (recv_len == -1) + if (recv_len == -1) { + free(msg); return -11; + } } printBuf((char *)msg, MSG_CMD_HDR_LEN + msg->len); res = host_message_handler(msg);