From 16d8bda4ec2966643aa7fd2623af7ba47095b954 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 22 Sep 2011 14:35:14 +0200 Subject: vdagentd: Fix a memory leak on agent message parsing errors Signed-off-by: Hans de Goede --- src/vdagentd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vdagentd.c b/src/vdagentd.c index 0cb7f1e..291e4e3 100644 --- a/src/vdagentd.c +++ b/src/vdagentd.c @@ -559,6 +559,7 @@ void agent_read_complete(struct udscs_connection **connp, fprintf(logfile, "guest xorg resolution message has wrong size, disconnecting agent\n"); udscs_destroy_connection(connp); + free(data); return; } @@ -573,6 +574,7 @@ void agent_read_complete(struct udscs_connection **connp, case VDAGENTD_CLIPBOARD_RELEASE: if (do_agent_clipboard(*connp, header, data)) { udscs_destroy_connection(connp); + free(data); return; } break; -- cgit v1.2.3