[FFmpeg-devel] [PATCH 07/22] lavfhttpd.c: Add allocation failure check.

Stephan Holljes klaxa1337 at googlemail.com
Fri Jun 1 01:24:00 EEST 2018


Signed-off-by: Stephan Holljes <klaxa1337 at googlemail.com>
---
 lavfhttpd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lavfhttpd.c b/lavfhttpd.c
index 3cf9958..5488e14 100644
--- a/lavfhttpd.c
+++ b/lavfhttpd.c
@@ -74,6 +74,10 @@ int lavfhttpd_accept(void *server, struct HTTPClient **client, int reply_code)
     client_ctx->seekable = 0;
     ret2 = HTTPD_OK;
     client_http = av_malloc(sizeof(struct HTTPClient));
+    if (!client_http) {
+        av_log(server, AV_LOG_ERROR, "Could not allocate http client.\n");
+        return HTTPD_OTHER_ERROR;
+    }
     client_http->method = NULL;
     client_http->resource = NULL;
     client_http->httpd_data = client_ctx;
-- 
2.16.2



More information about the ffmpeg-devel mailing list