summaryrefslogtreecommitdiff
path: root/src/encparse.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2010-05-14 20:15:18 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2010-05-17 08:20:46 -0700
commitaf4a0a752c169b2c003978c550d57602af3fbe01 (patch)
tree8bd17cb17ddf8caf89a1301c59608b74e83c403e /src/encparse.c
parent2218195ebb18b620f9e8e0adbea6f7c87ace33ce (diff)
Don't need to check if pointer is NULL before calling free()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
Diffstat (limited to 'src/encparse.c')
-rw-r--r--src/encparse.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/encparse.c b/src/encparse.c
index 33e0a05..5b4cefb 100644
--- a/src/encparse.c
+++ b/src/encparse.c
@@ -745,20 +745,19 @@ error:
if(encsize) free(enc); encsize=0;
if(namsize) {
for(i = first; i <= last; i++)
- if(nam[i])
- free(nam[i]);
+ free(nam[i]);
free(nam);
namsize = 0;
}
if(mapping) {
- if(mapping->client_data) free(mapping->client_data);
+ free(mapping->client_data);
free(mapping);
}
if(encoding) {
FontMapPtr nextmap;
- if (encoding->name) free(encoding->name);
+ free(encoding->name);
for (mapping = encoding->mappings; mapping; mapping = nextmap) {
- if (mapping->client_data) free(mapping->client_data);
+ free(mapping->client_data);
nextmap = mapping->next;
free(mapping);
}
@@ -930,8 +929,7 @@ FontEncIdentify(const char *fileName)
names = malloc((numaliases+2)*sizeof(char*));
if(names == NULL) {
- if(encoding->aliases)
- free(encoding->aliases);
+ free(encoding->aliases);
free(encoding);
return NULL;
}