summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-08-02 15:08:22 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-10-25 15:55:42 +0300
commitb06b463ff0e652afd487563ffa44b0886ea87e11 (patch)
treec5d074f88a09a6d81a10970e788c571ca933407e
parent0db9fedcf16a84f254a433983e52c5506233f8c1 (diff)
rtsp-client: Fix leaking of session in error cases
https://bugzilla.gnome.org/show_bug.cgi?id=755632
-rw-r--r--gst/rtsp-server/rtsp-client.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c
index c7620a8..9b3745b 100644
--- a/gst/rtsp-server/rtsp-client.c
+++ b/gst/rtsp-server/rtsp-client.c
@@ -2036,20 +2036,20 @@ media_not_found_no_reply:
{
GST_ERROR ("client %p: media '%s' not found", client, path);
/* error reply is already sent */
- goto cleanup_path;
+ goto cleanup_session;
}
media_not_found:
{
GST_ERROR ("client %p: media '%s' not found", client, path);
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx);
- goto cleanup_path;
+ goto cleanup_session;
}
control_not_found:
{
GST_ERROR ("client %p: no control in path '%s'", client, path);
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx);
g_object_unref (media);
- goto cleanup_path;
+ goto cleanup_session;
}
stream_not_found:
{
@@ -2057,14 +2057,14 @@ stream_not_found:
GST_STR_NULL (control));
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx);
g_object_unref (media);
- goto cleanup_path;
+ goto cleanup_session;
}
service_unavailable:
{
GST_ERROR ("client %p: can't create session", client);
send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx);
g_object_unref (media);
- goto cleanup_path;
+ goto cleanup_session;
}
sessmedia_unavailable:
{
@@ -2114,7 +2114,8 @@ keymgmt_error:
cleanup_session:
if (new_session)
gst_rtsp_session_pool_remove (priv->session_pool, session);
- g_object_unref (session);
+ if (session)
+ g_object_unref (session);
cleanup_path:
g_free (path);
return FALSE;