diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-06-03 06:33:40 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-06-03 06:33:40 +0000 |
commit | 2c2f63d0f17106964c808f8f0ec5bb58f35b4fe5 (patch) | |
tree | 0460d72b3f459c611145635c226bf725e95421c3 /src | |
parent | f991560c0f599d82b23380de4a681b0d218f5cef (diff) |
Coverity #1523: Dereferencing freed pointer "mapping"
Diffstat (limited to 'src')
-rw-r--r-- | src/encparse.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/encparse.c b/src/encparse.c index 62a889d..9375ed9 100644 --- a/src/encparse.c +++ b/src/encparse.c @@ -1,4 +1,4 @@ -/* $XdotOrg: $ */ +/* $XdotOrg: lib/fontenc/src/encparse.c,v 1.6 2006/04/10 16:15:12 alanc Exp $ */ /* Copyright (c) 1998-2001 by Juliusz Chroboczek @@ -773,12 +773,14 @@ error: xfree(mapping); } if(encoding) { - if(encoding->name) xfree(encoding->name); - for(mapping = encoding->mappings; mapping; mapping = mapping->next) { - if(mapping->client_data) xfree(mapping->client_data); - xfree(mapping); - } - xfree(encoding); + FontMapPtr nextmap; + if (encoding->name) xfree(encoding->name); + for (mapping = encoding->mappings; mapping; mapping = nextmap) { + if (mapping->client_data) xfree(mapping->client_data); + nextmap = mapping->next; + xfree(mapping); + } + xfree(encoding); } for(i = 0; i < numaliases; i++) xfree(aliases[i]); |