From b17f93a1d041e63261ff63419796136a26489549 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sat, 30 Oct 2010 10:00:13 +0200 Subject: Fix some potential memory leaks in SmcCloseConnection(). Signed-off-by: Kim Woelders Reviewed-by: Corbin Simpson --- src/sm_client.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/sm_client.c b/src/sm_client.c index 7e9c986..13059ce 100644 --- a/src/sm_client.c +++ b/src/sm_client.c @@ -317,6 +317,22 @@ SmcCloseConnection(SmcConn smcConn, int count, char **reasonMsgs) if (smcConn->client_id) free (smcConn->client_id); + if (smcConn->interact_waits) + { + _SmcInteractWait *ptr = smcConn->interact_waits; + _SmcInteractWait *next; + + while (ptr) + { + next = ptr->next; + free ((char *) ptr); + ptr = next; + } + } + + if (smcConn->phase2_wait) + free (smcConn->phase2_wait); + if (smcConn->prop_reply_waits) { _SmcPropReplyWait *ptr = smcConn->prop_reply_waits; -- cgit v1.2.1