diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-05-14 20:15:18 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-05-17 08:20:46 -0700 |
commit | af4a0a752c169b2c003978c550d57602af3fbe01 (patch) | |
tree | 8bd17cb17ddf8caf89a1301c59608b74e83c403e /src | |
parent | 2218195ebb18b620f9e8e0adbea6f7c87ace33ce (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')
-rw-r--r-- | src/encparse.c | 12 | ||||
-rw-r--r-- | src/fontenc.c | 9 |
2 files changed, 8 insertions, 13 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; } diff --git a/src/fontenc.c b/src/fontenc.c index 8718eff..86f5952 100644 --- a/src/fontenc.c +++ b/src/fontenc.c @@ -913,10 +913,8 @@ FontMapReverse(FontMapPtr mapping) return reverse; bail: - if(map) - free(map); - if(reverse) - free(reverse); + free(map); + free(reverse); return NULL; } @@ -930,8 +928,7 @@ FontMapReverseFree(FontMapReversePtr delendum) return; for(i = 0; i < FONTENC_SEGMENTS; i++) - if(map[i] != NULL) - free(map[i]); + free(map[i]); free(map); return; |