summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-03 06:33:40 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-03 06:33:40 +0000
commit2c2f63d0f17106964c808f8f0ec5bb58f35b4fe5 (patch)
tree0460d72b3f459c611145635c226bf725e95421c3 /src
parentf991560c0f599d82b23380de4a681b0d218f5cef (diff)
Coverity #1523: Dereferencing freed pointer "mapping"
Diffstat (limited to 'src')
-rw-r--r--src/encparse.c16
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]);