From: Daniel Mack Date: Fri, 17 Jan 2014 23:02:37 +0000 (+0100) Subject: handle: fix potential mem leak when kdbus_conn_kmsg_send() fails X-Git-Tag: upstream/0.20140120.123719~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33a6194b2f1bf75ca1d21c5bdfbb93c53dab3414;p=platform%2Fcore%2Fsystem%2Fkdbus-bus.git handle: fix potential mem leak when kdbus_conn_kmsg_send() fails --- diff --git a/handle.c b/handle.c index c5ef054..599fdc6 100644 --- a/handle.c +++ b/handle.c @@ -609,8 +609,10 @@ static long kdbus_handle_ioctl_ep_connected(struct file *file, unsigned int cmd, break; ret = kdbus_conn_kmsg_send(conn->ep, conn, kmsg); - if (ret < 0) + if (ret < 0) { + kdbus_kmsg_free(kmsg); break; + } /* store the offset of the reply back to userspace */ if (kmsg->msg.flags & KDBUS_MSG_FLAGS_SYNC_REPLY) {