From a1d9503d8e140029a9b24a729910a231d5934189 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 18 May 2006 22:06:32 +0000 Subject: [PATCH] Fix use-after-free in error case in fserve, as noted by Jerome Alet svn path=/icecast/trunk/icecast/; revision=11412 --- src/fserve.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fserve.c b/src/fserve.c index 2e5e54aa..80cb6010 100644 --- a/src/fserve.c +++ b/src/fserve.c @@ -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");