Commit cb601b77 authored by Sergey Lyubka's avatar Sergey Lyubka

Fix potential leak in handle_directory_request()

parent 6a43bd95
...@@ -2421,6 +2421,7 @@ static void handle_directory_request(struct mg_connection *conn, ...@@ -2421,6 +2421,7 @@ static void handle_directory_request(struct mg_connection *conn,
} }
if (entries == NULL) { if (entries == NULL) {
closedir(dirp);
send_http_error(conn, 500, "Cannot open directory", send_http_error(conn, 500, "Cannot open directory",
"%s", "Error: cannot allocate memory"); "%s", "Error: cannot allocate memory");
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment