aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-01-18 21:39:09 +0000
committerChristian Grothoff <christian@grothoff.org>2016-01-18 21:39:09 +0000
commitd9da87668f04dba7c164f2dab044a5858933b741 (patch)
treeda14a716cc02c5259d7dc8594aa420295708c65e
parentd22012f34da6e518ab178f9ee7c4a0f53c3d08d6 (diff)
downloadlibmicrohttpd-d9da87668f04dba7c164f2dab044a5858933b741.tar.gz
libmicrohttpd-d9da87668f04dba7c164f2dab044a5858933b741.zip
-fclose file, even if fileno failed...
-rw-r--r--src/examples/https_fileserver_example.c5
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 {