From c5060918164168c0a4f737b76e92df3c03356dc6 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 24 Dec 2013 09:18:17 -0800 Subject: Free iceConn->connection_string when unwinding after malloc fails Found by cppcheck 1.62: [src/accept.c:113]: (error) Memory leak: iceConn.connection_string Signed-off-by: Alan Coopersmith --- src/accept.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/accept.c b/src/accept.c index 6f23338..610e01b 100644 --- a/src/accept.c +++ b/src/accept.c @@ -110,6 +110,7 @@ IceAcceptConnection ( else { _IceTransClose (newconn); + free (iceConn->connection_string); free (iceConn); *statusRet = IceAcceptBadMalloc; return (NULL); @@ -122,6 +123,7 @@ IceAcceptConnection ( else { _IceTransClose (newconn); + free (iceConn->connection_string); free (iceConn->inbuf); free (iceConn); *statusRet = IceAcceptBadMalloc; -- cgit v1.2.3