Commit a1d9503d authored by Michael Smith's avatar Michael Smith

Fix use-after-free in error case in fserve, as noted by Jerome Alet

svn path=/icecast/trunk/icecast/; revision=11412
parent 25c55e1f
......@@ -465,13 +465,14 @@ int fserve_client_create (client_t *httpclient, const char *path)
}
file = fopen (fullpath, "rb");
free (fullpath);
if (file == NULL)
{
WARN1 ("Problem accessing file \"%s\"", fullpath);
client_send_404 (httpclient, "File not readable");
free (fullpath);
return -1;
}
free (fullpath);
content_length = (int64_t)file_buf.st_size;
range = httpp_getvar (httpclient->parser, "range");
......
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