diff mbox

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

Message ID 20180531222415.24966-8-klaxa1337@googlemail.com
State New
Headers show

Commit Message

Stephan Holljes May 31, 2018, 10:24 p.m. UTC
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
---
 lavfhttpd.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

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;