summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Gladstone <philipjsg@users.sourceforge.net>2003-09-27 01:23:40 +0000
committerPhilip Gladstone <philipjsg@users.sourceforge.net>2003-09-27 01:23:40 +0000
commit8bc80f8b24cb6f03ad209ce546ae594904c8b353 (patch)
treea32aec27555ea8ac3d3cb182627770af40dcb7db
parent80de6a80a9becd080d1d65a084b392aa69d42ef6 (diff)
downloadffmpeg-streaming-8bc80f8b24cb6f03ad209ce546ae594904c8b353.zip
ffmpeg-streaming-8bc80f8b24cb6f03ad209ce546ae594904c8b353.tar.gz
Minor bugfix to prevent segfault if a malloc fails. I have no idea what
will happen, but at least this crash is gone. Originally committed as revision 2307 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffserver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ffserver.c b/ffserver.c
index d665f4e..9587d7b 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -534,7 +534,6 @@ static int http_server(void)
first_http_ctx = NULL;
nb_connections = 0;
- first_http_ctx = NULL;
start_multicast();
@@ -681,8 +680,6 @@ static void new_connection(int server_fd, int is_rtsp)
if (!c)
goto fail;
- c->next = first_http_ctx;
- first_http_ctx = c;
c->fd = fd;
c->poll_entry = NULL;
c->from_addr = from_addr;
@@ -690,6 +687,9 @@ static void new_connection(int server_fd, int is_rtsp)
c->buffer = av_malloc(c->buffer_size);
if (!c->buffer)
goto fail;
+
+ c->next = first_http_ctx;
+ first_http_ctx = c;
nb_connections++;
start_wait_request(c, is_rtsp);
OpenPOWER on IntegriCloud