[farsight2/master] Use fs_candidate_new() function and fix leak (double malloc)
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:21:57 PST 2008
---
transmitters/rawudp/fs-rawudp-stream-transmitter.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/transmitters/rawudp/fs-rawudp-stream-transmitter.c b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
index 7c8da5b..526ba83 100644
--- a/transmitters/rawudp/fs-rawudp-stream-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
@@ -1081,16 +1081,14 @@ fs_rawudp_stream_transmitter_build_forced_candidate (
FsRawUdpStreamTransmitter *self, const char *ip, gint port,
guint component_id)
{
- FsCandidate *candidate = g_new0 (FsCandidate, 1);
+ FsCandidate *candidate;
+ gchar *id;
- candidate = g_new0 (FsCandidate,1);
- candidate->candidate_id = g_strdup_printf ("L%u",
+ id = g_strdup_printf ("L%u",
self->priv->next_candidate_id++);
- candidate->component_id = component_id;
- candidate->ip = g_strdup (ip);
- candidate->port = port;
- candidate->proto = FS_NETWORK_PROTOCOL_UDP;
- candidate->type = FS_CANDIDATE_TYPE_HOST;
+ candidate = fs_candidate_new (id, component_id, FS_CANDIDATE_TYPE_HOST,
+ FS_NETWORK_PROTOCOL_UDP, ip, port);
+ g_free (id);
return candidate;
}
--
1.5.6.5
More information about the farsight-commits
mailing list