summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2006-04-07 00:35:36 +0000
committerAdam Jackson <ajax@nwnk.net>2006-04-07 00:35:36 +0000
commitd86b38b96854bc60d4a2c4595e73cf53aa36d85c (patch)
treec6cac7e0bb20c5c6138f98d9e7bc60a5489f2203 /src
parent78f355698128454370590040699c2141ae69d7d9 (diff)
Coverity #544: File a file descriptor leak.XORG-7_0_99_901
Diffstat (limited to 'src')
-rw-r--r--src/encparse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/encparse.c b/src/encparse.c
index 285f5a1..2263c95 100644
--- a/src/encparse.c
+++ b/src/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 {