ソースを参照

Fix potential leak in handle_directory_request()

Sergey Lyubka 14 年 前
コミット
cb601b7718
1 ファイル変更1 行追加0 行削除
  1. 1 0
      mongoose.c

+ 1 - 0
mongoose.c

@@ -2421,6 +2421,7 @@ static void handle_directory_request(struct mg_connection *conn,
     }
 
     if (entries == NULL) {
+      closedir(dirp);
       send_http_error(conn, 500, "Cannot open directory",
           "%s", "Error: cannot allocate memory");
       return;