[PATCHv3 06/14] xi: fix memory leak in ProcXIQueryDevice

Tiago Vignatti tiago.vignatti at nokia.com
Tue Mar 29 08:08:12 PDT 2011


Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
Reviewed-by: Nicolas Peninguy <nico at lostgeeks.org>
---
 Xi/xiquerydevice.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index 8b54211..8b69904 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -107,8 +107,10 @@ ProcXIQueryDevice(ClientPtr client)
     }
 
     info = calloc(1, len);
-    if (!info)
+    if (!info) {
+        free(skip);
         return BadAlloc;
+    }
 
     memset(&rep, 0, sizeof(xXIQueryDeviceReply));
     rep.repType = X_Reply;
-- 
1.7.0.4



More information about the xorg-devel mailing list