Commit 18ef745a authored by Dafydd Harries's avatar Dafydd Harries

fix memory leak in nice/test-util

darcs-hash:20070201200015-c9803-7b1c84f3f4649d3a164332288344615e1995d995.gz
parent 59e7e39c
...@@ -21,7 +21,7 @@ nice_candidate_from_string (const gchar *s) ...@@ -21,7 +21,7 @@ nice_candidate_from_string (const gchar *s)
bits = g_strsplit (s, "/", 3); bits = g_strsplit (s, "/", 3);
if (g_strv_length (bits) != 3) if (g_strv_length (bits) != 3)
return NULL; goto ERROR;
switch (bits[0][0]) switch (bits[0][0])
{ {
...@@ -38,13 +38,13 @@ nice_candidate_from_string (const gchar *s) ...@@ -38,13 +38,13 @@ nice_candidate_from_string (const gchar *s)
type = NICE_CANDIDATE_TYPE_RELAYED; type = NICE_CANDIDATE_TYPE_RELAYED;
break; break;
default: default:
return NULL; goto ERROR;
} }
/* extract IP address */ /* extract IP address */
if (inet_pton (AF_INET, bits[1], &ip) < 1) if (inet_pton (AF_INET, bits[1], &ip) < 1)
return NULL; goto ERROR;
/* extract port */ /* extract port */
...@@ -54,7 +54,12 @@ nice_candidate_from_string (const gchar *s) ...@@ -54,7 +54,12 @@ nice_candidate_from_string (const gchar *s)
nice_address_set_ipv4 (&candidate->addr, ntohl (ip)); nice_address_set_ipv4 (&candidate->addr, ntohl (ip));
candidate->port = port; candidate->port = port;
g_strfreev (bits);
return candidate; return candidate;
ERROR:
g_strfreev (bits);
return NULL;
} }
gchar * gchar *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment