diff options
author | Vineeth TM <vineeth.tm@samsung.com> | 2015-11-18 14:48:36 +0900 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-11-18 09:31:42 +0200 |
commit | bd701b8ee52b8dd72db6b36f3c8179ec998756b5 (patch) | |
tree | 1f747da77b515bf2510fe43e73aff9035434ad3d | |
parent | 84b6743cf813651a6a6107ab3a875d2108cb6da7 (diff) |
souphttpclientsink: Fix error leak and handle error
g_thread_try_new allows for possiblity of failures. In case it fails,
error is not handled and leaked.
https://bugzilla.gnome.org/show_bug.cgi?id=758260
-rw-r--r-- | ext/soup/gstsouphttpclientsink.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/soup/gstsouphttpclientsink.c b/ext/soup/gstsouphttpclientsink.c index 07efdc2c5..108aabfc3 100644 --- a/ext/soup/gstsouphttpclientsink.c +++ b/ext/soup/gstsouphttpclientsink.c @@ -562,10 +562,17 @@ gst_soup_http_client_sink_start (GstBaseSink * sink) g_mutex_lock (&souphttpsink->mutex); - /* FIXME: error handling */ souphttpsink->thread = g_thread_try_new ("souphttpclientsink-thread", thread_func, souphttpsink, &error); + if (error != NULL) { + GST_DEBUG_OBJECT (souphttpsink, "failed to start thread, %s", + error->message); + g_error_free (error); + g_mutex_unlock (&souphttpsink->mutex); + return FALSE; + } + GST_LOG_OBJECT (souphttpsink, "waiting for main loop thread to start up"); g_cond_wait (&souphttpsink->cond, &souphttpsink->mutex); g_mutex_unlock (&souphttpsink->mutex); |