From 8dd9db15febf97548f1bc079e91600aafa47030a Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 25 Jul 2014 09:44:51 +0530 Subject: misc syntactic changes -- no behaviour changes --- src/encode.c | 2 +- src/main.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/encode.c b/src/encode.c index a18fe5e..72e91a7 100644 --- a/src/encode.c +++ b/src/encode.c @@ -149,9 +149,9 @@ on_demuxer_pad_added (GstElement *demuxer, sinkpad = gst_element_get_static_pad (rtppay, "sink"); gst_pad_link (srcpad, sinkpad); stp_print_status ("Streaming a vp8 stream on UDP\n"); + gst_object_unref (sinkpad); out: g_free (name); - gst_object_unref (sinkpad); } static void diff --git a/src/main.c b/src/main.c index 926dc86..8d13d7c 100644 --- a/src/main.c +++ b/src/main.c @@ -89,7 +89,7 @@ stp_validate_fetch_token_from_query (GHashTable *tokens, { GHashTable *query; char *type, *udp_clients; - STPStreamToken *token, *valid_token; + STPStreamToken *token, *perms_token; if (!query_string) { *http_status_code = SOUP_STATUS_BAD_REQUEST; @@ -111,25 +111,21 @@ stp_validate_fetch_token_from_query (GHashTable *tokens, type = g_hash_table_lookup (query, "type"); token->stream_type = stp_get_stream_type_from_string (type); - valid_token = g_hash_table_lookup (tokens, sessionid); + perms_token = g_hash_table_lookup (tokens, sessionid); if (stp_inet_addrmask && - valid_token->stream_type != token->stream_type) { + perms_token->stream_type != token->stream_type) { *http_status_code = SOUP_STATUS_FORBIDDEN; - g_free (token); - token = NULL; - goto out; + goto err; } if (!(token->stream_type & STP_STREAM_TYPE_RTP_UDP)) goto out; - /* Host and port are only needed for RTP streaming */ + /* Only needed for RTP streaming */ udp_clients = g_hash_table_lookup (query, "udp-clients"); if (!udp_clients) { *http_status_code = SOUP_STATUS_BAD_REQUEST; - g_free (token); - token = NULL; - goto out; + goto err; } token->udp_clients = g_strdup (udp_clients); @@ -137,6 +133,10 @@ stp_validate_fetch_token_from_query (GHashTable *tokens, out: g_hash_table_destroy (query); return token; +err: + g_free (token); + token = NULL; + goto out; } static void -- cgit v0.11.2-2-gd1dd