diff options
author | Adam Jackson <ajax@nwnk.net> | 2006-04-07 00:35:36 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2006-04-07 00:35:36 +0000 |
commit | d86b38b96854bc60d4a2c4595e73cf53aa36d85c (patch) | |
tree | c6cac7e0bb20c5c6138f98d9e7bc60a5489f2203 | |
parent | 78f355698128454370590040699c2141ae69d7d9 (diff) |
Coverity #544: File a file descriptor leak.XORG-7_0_99_901
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/encparse.c | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2006-04-06 Adam Jackson <ajax@freedesktop.org> + + * src/encparse.c: + Coverity #544: File a file descriptor leak. + 2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org> * configure.ac: 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 { |