summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-12-24 09:18:17 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-12-24 09:36:24 -0800
commitc5060918164168c0a4f737b76e92df3c03356dc6 (patch)
treec9bb990cc9b618a5f9dd0a68ecca73b85f5f4cda
parent80f62c54fbd50a3bbdf9c37258525098c9117830 (diff)
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 <alan.coopersmith@oracle.com>
-rw-r--r--src/accept.c2
1 files changed, 2 insertions, 0 deletions
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;