[PATCH 2/2] connection: Add missing free from error path

Rob Bradford robert.bradford at intel.com
Tue Oct 9 10:46:22 PDT 2012


From: Rob Bradford <rob at linux.intel.com>

On the error codepath that errors out on ENOMEM we should free the allocated
closure.

Signed-off-by: Rob Bradford <rob at linux.intel.com>
---
 src/connection.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/connection.c b/src/connection.c
index dbe0fa9..8f4b44c 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -611,6 +611,7 @@ err:
 	printf("request too big to marshal, maximum size is %zu\n",
 	       sizeof closure->buffer);
 	errno = ENOMEM;
+	free(closure);
 
 	return NULL;
 
-- 
1.7.11.2



More information about the wayland-devel mailing list