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:
parent
7ae46b69ba
commit
12e46e8373
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user