aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/font/fontfile/encparse.c
diff options
context:
space:
mode:
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);