mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 00:10:05 +01:00
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
009b226a48
commit
5edb3822b9
1 changed files with 3 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue