From 12e46e83733b47d2704e1509960192365102af46 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Fri, 25 Mar 2011 22:07:31 +0200 Subject: [PATCH] dix: fix memory leak in SetDefaultFontPath Signed-off-by: Tiago Vignatti Reviewed-by: Nicolas Peninguy Reviewed-by: Peter Hutterer --- dix/dixfonts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 71689cff7..fbac124da 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1815,8 +1815,10 @@ SetDefaultFontPath(char *path) /* get enough for string, plus values -- use up commas */ len = strlen(temp_path) + 1; nump = cp = newpath = malloc(len); - if (!newpath) + if (!newpath) { + free(temp_path); return BadAlloc; + } pp = (unsigned char *) temp_path; cp++; while (*pp) {