Преглед изворни кода

-fclose file, even if fileno failed...

Christian Grothoff пре 10 година
родитељ
комит
d9da87668f
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      src/examples/https_fileserver_example.c

+ 4 - 1
src/examples/https_fileserver_example.c

@@ -143,7 +143,10 @@ http_ahc (void *cls,
     {
       fd = fileno (file);
       if (-1 == fd)
-        return MHD_NO; /* internal error */
+        {
+          (void) fclose (file);
+          return MHD_NO; /* internal error */
+        }
       if ( (0 != fstat (fd, &buf)) ||
            (! S_ISREG (buf.st_mode)) )
         {