dix: fix memory leak in SetDefaultFontPath

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Tiago Vignatti 2011-03-25 22:07:31 +02:00
parent 009b226a48
commit 5edb3822b9

View file

@ -1825,8 +1825,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) {