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 7ae46b69ba
commit 12e46e8373

View File

@ -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) {