[PATCH 04/11] xi: fix memory leak in ProcXListProperties and ProcXIListProperties

Tiago Vignatti tiago.vignatti at nokia.com
Fri Mar 25 11:41:46 PDT 2011


Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
 Xi/xiproperty.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 83ce930..b55e7f3 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -904,8 +904,8 @@ ProcXListDeviceProperties (ClientPtr client)
     {
         client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
         WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms);
-        free(atoms);
     }
+    free(atoms);
     return rc;
 }
 
@@ -1148,8 +1148,8 @@ ProcXIListProperties(ClientPtr client)
     {
         client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
         WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms);
-        free(atoms);
     }
+    free(atoms);
     return rc;
 }
 
-- 
1.7.0.4



More information about the xorg-devel mailing list