[gnac/devel] Fixed memory leaks
- From: Benoît Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Fixed memory leaks
- Date: Fri, 15 Oct 2010 19:52:23 +0000 (UTC)
commit c5d25da3bca8a4c647beca5ed521126947e98ed6
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Fri Oct 15 20:52:15 2010 +0100
Fixed memory leaks
libgnac/libgnac-gst-utils.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/libgnac/libgnac-gst-utils.c b/libgnac/libgnac-gst-utils.c
index b2eb2bc..fe9dd3b 100644
--- a/libgnac/libgnac-gst-utils.c
+++ b/libgnac/libgnac-gst-utils.c
@@ -156,22 +156,30 @@ libgnac_gstu_get_compatible_pad(GstElement *element,
GstCaps *caps,
const gchar *type)
{
+ gchar *pad_name;
GstPad *sink_pad;
+
+ pad_name = gst_pad_get_name(pad);
+
sink_pad = gst_element_get_compatible_pad(element, pad, caps);
if (!sink_pad) {
+ gchar *caps_str = gst_caps_to_string(caps);
libgnac_debug("Unable to find a compatible %s pad "
- "(sink_pad = %s, caps = %s\n)", type, gst_pad_get_name(pad),
- gst_caps_to_string(caps));
+ "(sink_pad = %s, caps = %s\n)", type, pad_name, caps_str);
+ g_free(pad_name);
+ g_free(caps_str);
gst_caps_unref(caps);
return FALSE;
}
- libgnac_debug("%s: %s -> %s", type,
- gst_pad_get_name(pad), gst_pad_get_name(sink_pad));
+ sink_pad_name = gst_pad_get_name(sink_pad);
+
+ libgnac_debug("%s: %s -> %s", type, pad_name, sink_pad_name);
if (GST_PAD_IS_LINKED(sink_pad)) {
- libgnac_debug("%s pad %s is already linked", type,
- gst_pad_get_name(sink_pad));
+ libgnac_debug("%s pad %s is already linked", type, sink_pad_name);
+ g_free(pad_name);
+ g_free(sink_pad_name);
g_object_unref(sink_pad);
gst_caps_unref(caps);
return FALSE;
@@ -180,6 +188,9 @@ libgnac_gstu_get_compatible_pad(GstElement *element,
g_return_val_if_fail(
libgnac_gstu_pad_link(pad, sink_pad, NULL) == GST_PAD_LINK_OK,
FALSE);
+
+ g_free(pad_name);
+ g_free(sink_pad_name);
g_object_unref(sink_pad);
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]