From: Peter Howkins Date: Tue, 3 Jul 2018 17:52:02 +0000 (+0100) Subject: dtstyle: Coverity 87244 X-Git-Tag: 2.3.0a~227 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8b39102f317f1654e3caad561c573c1a15f4b136;p=oweals%2Fcde.git dtstyle: Coverity 87244 --- diff --git a/cde/programs/dtstyle/ColorFile.c b/cde/programs/dtstyle/ColorFile.c index 5c87e8cf..564ab169 100644 --- a/cde/programs/dtstyle/ColorFile.c +++ b/cde/programs/dtstyle/ColorFile.c @@ -1112,7 +1112,7 @@ CheckFileType( void ) { char *filename1 = "abcdefghijklmno"; char *filename2 = "abcdefghijklmn"; - int fd, fd1; + int fd = -1, fd1 = -1; char *tmpfile1, *tmpfile2; /* get the $HOME environment varible and constuct the full file name */ @@ -1162,7 +1162,9 @@ CheckFileType( void ) XtFree(tmpfile1); XtFree(tmpfile2); close(fd); - close(fd1); + if(fd1 != -1) { + close(fd1); + } }