From 33a6194b2f1bf75ca1d21c5bdfbb93c53dab3414 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Sat, 18 Jan 2014 00:02:37 +0100 Subject: [PATCH] handle: fix potential mem leak when kdbus_conn_kmsg_send() fails --- handle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.34.1