aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/font/fontfile/encparse.c
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-10-10 17:47:42 +0200
committerReinhard Tartler <siretart@tauware.de>2011-10-10 17:47:42 +0200
commit5036ffbe6500adc6f55d6b814a21f5222114ca18 (patch)
tree42670b9190eeb16627c36aaed639837a0bd1389c /nx-X11/lib/font/fontfile/encparse.c
parentbd433c6487a52f95e6bb949d5698dc5ea0923713 (diff)
downloadnx-libs-5036ffbe6500adc6f55d6b814a21f5222114ca18.tar.gz
nx-libs-5036ffbe6500adc6f55d6b814a21f5222114ca18.tar.bz2
nx-libs-5036ffbe6500adc6f55d6b814a21f5222114ca18.zip
Imported nx-X11-3.3.0-7.tar.gznx-X11/3.3.0-7
Summary: Imported nx-X11-3.3.0-7.tar.gz Keywords: Imported nx-X11-3.3.0-7.tar.gz into Git repository
Diffstat (limited to 'nx-X11/lib/font/fontfile/encparse.c')
-rw-r--r--nx-X11/lib/font/fontfile/encparse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nx-X11/lib/font/fontfile/encparse.c b/nx-X11/lib/font/fontfile/encparse.c
index 285f5a17d..6262aff07 100644
--- a/nx-X11/lib/font/fontfile/encparse.c
+++ b/nx-X11/lib/font/fontfile/encparse.c
@@ -867,8 +867,10 @@ FontEncReallyReallyLoad(const char *charset,
if(!strcasecmp(encoding_name, charset)) {
/* Found it */
if(file_name[0] != '/') {
- if(strlen(dir) + strlen(file_name) >= MAXFONTFILENAMELEN)
+ if(strlen(dir) + strlen(file_name) >= MAXFONTFILENAMELEN) {
+ fclose(file);
return NULL;
+ }
strcpy(buf, dir);
strcat(buf, file_name);
} else {
@@ -877,6 +879,7 @@ FontEncReallyReallyLoad(const char *charset,
f = FontFileOpen(buf);
if(f == NULL) {
+ fclose(file);
return NULL;
}
encoding = parseEncodingFile(f, 0);