diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-01-18 21:39:09 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-01-18 21:39:09 +0000 |
commit | d9da87668f04dba7c164f2dab044a5858933b741 (patch) | |
tree | da14a716cc02c5259d7dc8594aa420295708c65e | |
parent | d22012f34da6e518ab178f9ee7c4a0f53c3d08d6 (diff) | |
download | libmicrohttpd-d9da87668f04dba7c164f2dab044a5858933b741.tar.gz libmicrohttpd-d9da87668f04dba7c164f2dab044a5858933b741.zip |
-fclose file, even if fileno failed...
-rw-r--r-- | src/examples/https_fileserver_example.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/examples/https_fileserver_example.c b/src/examples/https_fileserver_example.c index 99ec50b3..1479f23d 100644 --- a/src/examples/https_fileserver_example.c +++ b/src/examples/https_fileserver_example.c | |||
@@ -143,7 +143,10 @@ http_ahc (void *cls, | |||
143 | { | 143 | { |
144 | fd = fileno (file); | 144 | fd = fileno (file); |
145 | if (-1 == fd) | 145 | if (-1 == fd) |
146 | return MHD_NO; /* internal error */ | 146 | { |
147 | (void) fclose (file); | ||
148 | return MHD_NO; /* internal error */ | ||
149 | } | ||
147 | if ( (0 != fstat (fd, &buf)) || | 150 | if ( (0 != fstat (fd, &buf)) || |
148 | (! S_ISREG (buf.st_mode)) ) | 151 | (! S_ISREG (buf.st_mode)) ) |
149 | { | 152 | { |