From 6eb8db8afd1a8186be5b155fd945e679b56ccc77 Mon Sep 17 00:00:00 2001 From: Vineeth TM Date: Mon, 12 Oct 2015 11:18:51 +0900 Subject: [PATCH] souphttpclientsink: Check if soup message is created If soup message is not created then the same should not be passed on, which is resulting in segfault. Hence throwing a warning message and returning https://bugzilla.gnome.org/show_bug.cgi?id=755326 --- ext/soup/gstsouphttpclientsink.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/soup/gstsouphttpclientsink.c b/ext/soup/gstsouphttpclientsink.c index 24e507e2e4..fe5bf726b8 100644 --- a/ext/soup/gstsouphttpclientsink.c +++ b/ext/soup/gstsouphttpclientsink.c @@ -658,6 +658,15 @@ send_message_locked (GstSoupHttpClientSink * souphttpsink) } souphttpsink->message = soup_message_new ("PUT", souphttpsink->location); + if (souphttpsink->message == NULL) { + GST_WARNING_OBJECT (souphttpsink, + "URI could not be parsed while creating message."); + g_list_free_full (souphttpsink->queued_buffers, + (GDestroyNotify) gst_buffer_unref); + souphttpsink->queued_buffers = NULL; + return; + } + soup_message_set_flags (souphttpsink->message, (souphttpsink->automatic_redirect ? 0 : SOUP_MESSAGE_NO_REDIRECT));