summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 10 insertions, 10 deletions
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