[PATCH 07/15] xkb: Fix memory leak in error path

Pauli Nieminen ext-pauli.nieminen at nokia.com
Tue Jul 27 05:09:48 PDT 2010


map is allocated but not freed if reply length and data don't match.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 xkb/xkb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 9a5d5b3..452bf2c 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -3027,6 +3027,7 @@ register unsigned	bit;
 	    to = (CARD8 *)wire;
 	    if ((to-map)!=length) {
 		client->errorValue = _XkbErrCode2(0xff,length);
+		free(map);
 		return BadLength;
 	    }
 	}
-- 
1.6.3.3



More information about the xorg-devel mailing list