summaryrefslogtreecommitdiff
path: root/dix/dixfonts.c
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-06-06 15:28:30 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-06-06 20:27:18 +0700
commit0a4d8cbdcd7b25313fb29ccdb498044af95f7de6 (patch)
tree3534c9035180b7e0d2ebbbf0202a370cb61f8e8d /dix/dixfonts.c
parent5a0fc0ad21d562612676ef88ef2d533b2391810a (diff)
Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'dix/dixfonts.c')
-rw-r--r--dix/dixfonts.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 51c7ab64c..e32117748 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -677,7 +677,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
return TRUE;
}
if (err == FontNameAlias) {
- if (resolved) free(resolved);
+ free(resolved);
resolved = malloc(resolvedlen + 1);
if (resolved)
memmove(resolved, tmpname, resolvedlen + 1);
@@ -731,8 +731,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
{
c->saved = c->current;
c->haveSaved = TRUE;
- if (c->savedName)
- free(c->savedName);
+ free(c->savedName);
c->savedName = malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
@@ -828,10 +827,10 @@ 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);
FreeFontNames(names);
free(c);
- if (resolved) free(resolved);
+ free(resolved);
return TRUE;
}
@@ -994,8 +993,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 = malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
@@ -1106,7 +1104,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;
}