aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2018-06-21 23:30:34 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-07-03 16:13:43 +0200
commita2008b28ed657292f53e96e0ab03ce99f56cf1f6 (patch)
tree223575d96ef4e3150d651aeeadcdf5ed942e6b6d /nx-X11/programs
parente0291f30df9df99bfbd987e7d181237925d3c0e3 (diff)
downloadnx-libs-a2008b28ed657292f53e96e0ab03ce99f56cf1f6.tar.gz
nx-libs-a2008b28ed657292f53e96e0ab03ce99f56cf1f6.tar.bz2
nx-libs-a2008b28ed657292f53e96e0ab03ce99f56cf1f6.zip
NXdixfonts.c: free() can handle NULL
so let's remove some superflous tests
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
index 8b3fdcc8d..50bf719c6 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
@@ -478,7 +478,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);
@@ -544,8 +544,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);
@@ -663,14 +662,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;
}
@@ -856,8 +855,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);
@@ -983,7 +981,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;
}
@@ -1201,7 +1199,7 @@ nxdoListFontsAndAliases(client, fss)
return TRUE;
}
if (err == FontNameAlias) {
- if (resolved) free(resolved);
+ free(resolved);
resolved = (char *) malloc(resolvedlen + 1);
if (resolved)
{
@@ -1273,8 +1271,7 @@ nxdoListFontsAndAliases(client, fss)
{
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)
{
@@ -1370,7 +1367,7 @@ finish:
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(c->names);
#else
@@ -1378,7 +1375,7 @@ finish:
#endif /* HAS_XFONT2 */
free(c);
free(fss);
- if (resolved) free(resolved);
+ free(resolved);
return doOpenFont(client, oc);
}