aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-07-03 16:17:56 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-07-03 16:17:56 +0200
commit59e46dc54e4fa7590a058e58bb121c1e4de992eb (patch)
tree5513b0a844e1657eaaab7f66d7c8dacf85e3f618 /nx-X11
parenta2008b28ed657292f53e96e0ab03ce99f56cf1f6 (diff)
downloadnx-libs-59e46dc54e4fa7590a058e58bb121c1e4de992eb.tar.gz
nx-libs-59e46dc54e4fa7590a058e58bb121c1e4de992eb.tar.bz2
nx-libs-59e46dc54e4fa7590a058e58bb121c1e4de992eb.zip
dix/dixfonts.c: free() can handle NULL
so let's remove some superflous tests
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/dix/dixfonts.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c
index 0d90cd7b0..752a7eb6d 100644
--- a/nx-X11/programs/Xserver/dix/dixfonts.c
+++ b/nx-X11/programs/Xserver/dix/dixfonts.c
@@ -741,7 +741,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
return TRUE;
}
if (err == FontNameAlias) {
- if (resolved) free(resolved);
+ free(resolved);
resolved = (char *) malloc(resolvedlen + 1);
if (resolved)
memmove(resolved, tmpname, resolvedlen + 1);
@@ -807,8 +807,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
{
c->saved = c->current;
c->haveSaved = TRUE;
- if (c->savedName)
- free(c->savedName);
+ free(c->savedName);
c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
@@ -904,14 +903,14 @@ bail:
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
free(c->fpe_list);
- if (c->savedName) free(c->savedName);
+ free(c->savedName);
#ifdef HAS_XFONT2
xfont2_free_font_names(names);
#else
FreeFontNames(names);
#endif /* HAS_XFONT2 */
free(c);
- if (resolved) free(resolved);
+ free(resolved);
return TRUE;
}
@@ -1091,8 +1090,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
c->saved = c->current;
c->haveSaved = TRUE;
c->savedNumFonts = numFonts;
- if (c->savedName)
- free(c->savedName);
+ free(c->savedName);
c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
@@ -1203,7 +1201,7 @@ bail:
FreeFPE(c->fpe_list[i]);
free(c->reply);
free(c->fpe_list);
- if (c->savedName) free(c->savedName);
+ free(c->savedName);
free(c);
return TRUE;
}