[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [PATCH libSM] Fix some potential memory leaks in SmcCloseConnection().
From:       Kim Woelders <kim () woelders ! dk>
Date:       2010-10-30 8:51:00
Message-ID: 1288428660-5081-1-git-send-email-kim () woelders ! dk
[Download RAW message or body]


Signed-off-by: Kim Woelders <kim@woelders.dk>

diff --git a/src/sm_client.c b/src/sm_client.c
index a5c714f..5454398 100644
--- a/src/sm_client.c
+++ b/src/sm_client.c
@@ -325,6 +325,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;
-- 
1.7.3.2

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic