From af4a0a752c169b2c003978c550d57602af3fbe01 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 14 May 2010 20:15:18 -0700 Subject: Don't need to check if pointer is NULL before calling free() Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp --- src/encparse.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/encparse.c') 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; } -- cgit v1.2.3