gst/rtpmanager/: Fix some leaks.

Original commit message from CVS:
* gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_finalize),
(gst_rtp_bin_set_sdes_string), (gst_rtp_bin_get_sdes_string),
(gst_rtp_bin_handle_message):
* gst/rtpmanager/rtpsession.c: (rtp_session_finalize),
(rtp_session_send_bye):
* gst/rtpmanager/rtpsource.c: (rtp_source_finalize):
Fix some leaks.
This commit is contained in:
Wim Taymans 2007-12-12 12:11:53 +00:00
parent 4d9802a3ac
commit 4e481affe2
4 changed files with 27 additions and 0 deletions

View file

@ -1,3 +1,13 @@
2007-12-12 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_finalize),
(gst_rtp_bin_set_sdes_string), (gst_rtp_bin_get_sdes_string),
(gst_rtp_bin_handle_message):
* gst/rtpmanager/rtpsession.c: (rtp_session_finalize),
(rtp_session_send_bye):
* gst/rtpmanager/rtpsource.c: (rtp_source_finalize):
Fix some leaks.
2007-12-12 Sebastian Dröge <slomo@circular-chaos.org> 2007-12-12 Sebastian Dröge <slomo@circular-chaos.org>
* ext/dts/gstdtsdec.c: (gst_dtsdec_init), * ext/dts/gstdtsdec.c: (gst_dtsdec_init),

View file

@ -1294,9 +1294,13 @@ static void
gst_rtp_bin_finalize (GObject * object) gst_rtp_bin_finalize (GObject * object)
{ {
GstRtpBin *rtpbin; GstRtpBin *rtpbin;
gint i;
rtpbin = GST_RTP_BIN (object); rtpbin = GST_RTP_BIN (object);
for (i = 0; i < 9; i++)
g_free (rtpbin->sdes[i]);
g_mutex_free (rtpbin->priv->bin_lock); g_mutex_free (rtpbin->priv->bin_lock);
gst_object_unref (rtpbin->provided_clock); gst_object_unref (rtpbin->provided_clock);
@ -1347,6 +1351,9 @@ gst_rtp_bin_set_sdes_string (GstRtpBin * bin, GstRTCPSDESType type,
GSList *item; GSList *item;
const gchar *name; const gchar *name;
if (type < 0 || type > 8)
return;
GST_OBJECT_LOCK (bin); GST_OBJECT_LOCK (bin);
g_free (bin->sdes[type]); g_free (bin->sdes[type]);
bin->sdes[type] = g_strdup (data); bin->sdes[type] = g_strdup (data);
@ -1362,6 +1369,9 @@ gst_rtp_bin_get_sdes_string (GstRtpBin * bin, GstRTCPSDESType type)
{ {
gchar *result; gchar *result;
if (type < 0 || type > 8)
return NULL;
GST_OBJECT_LOCK (bin); GST_OBJECT_LOCK (bin);
result = g_strdup (bin->sdes[type]); result = g_strdup (bin->sdes[type]);
GST_OBJECT_UNLOCK (bin); GST_OBJECT_UNLOCK (bin);

View file

@ -323,6 +323,8 @@ rtp_session_finalize (GObject * object)
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
g_hash_table_destroy (sess->ssrcs[i]); g_hash_table_destroy (sess->ssrcs[i]);
g_free (sess->bye_reason);
g_hash_table_destroy (sess->cnames); g_hash_table_destroy (sess->cnames);
g_object_unref (sess->source); g_object_unref (sess->source);
@ -1577,6 +1579,7 @@ rtp_session_send_bye (RTPSession * sess, const gchar * reason)
/* we have BYE now */ /* we have BYE now */
source->received_bye = TRUE; source->received_bye = TRUE;
/* at least one member wants to send a BYE */ /* at least one member wants to send a BYE */
g_free (sess->bye_reason);
sess->bye_reason = g_strdup (reason); sess->bye_reason = g_strdup (reason);
sess->stats.avg_rtcp_packet_size = 100; sess->stats.avg_rtcp_packet_size = 100;
sess->stats.bye_members = 1; sess->stats.bye_members = 1;

View file

@ -169,6 +169,7 @@ rtp_source_finalize (GObject * object)
{ {
RTPSource *src; RTPSource *src;
GstBuffer *buffer; GstBuffer *buffer;
gint i;
src = RTP_SOURCE_CAST (object); src = RTP_SOURCE_CAST (object);
@ -176,6 +177,9 @@ rtp_source_finalize (GObject * object)
gst_buffer_unref (buffer); gst_buffer_unref (buffer);
g_queue_free (src->packets); g_queue_free (src->packets);
for (i = 0; i < 9; i++)
g_free (src->sdes[i]);
g_free (src->bye_reason); g_free (src->bye_reason);
G_OBJECT_CLASS (rtp_source_parent_class)->finalize (object); G_OBJECT_CLASS (rtp_source_parent_class)->finalize (object);