diff options
author | Stefan Kost <ensonic@users.sf.net> | 2010-02-19 22:50:18 +0200 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.co.uk> | 2010-09-08 17:15:48 -0300 |
commit | af83f0afd7df0640394fe4ae2b57bca8b7a59f01 (patch) | |
tree | c557ae58df0041e0d18c7955a31957495855467d /ext | |
parent | f35f701996d2d46cb47d32e1e249805b7bc47ad5 (diff) | |
download | gstreamer-plugins-bad-af83f0afd7df0640394fe4ae2b57bca8b7a59f01.tar.gz |
faceblur: fix handling of profile property.
Dup and free the string. Fixes leaking new values and avoids crashing
gst-inspect.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/opencv/faceblur/gstfaceblur.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/opencv/faceblur/gstfaceblur.c b/ext/opencv/faceblur/gstfaceblur.c index e9da8f824..5f1deb3a4 100644 --- a/ext/opencv/faceblur/gstfaceblur.c +++ b/ext/opencv/faceblur/gstfaceblur.c @@ -118,6 +118,8 @@ gst_faceblur_finalize (GObject * obj) cvReleaseImage (&filter->cvImage); cvReleaseImage (&filter->cvGray); } + + g_free (filter->profile); G_OBJECT_CLASS (parent_class)->finalize (obj); } @@ -184,7 +186,7 @@ gst_faceblur_init (Gstfaceblur * filter, GstfaceblurClass * gclass) gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); - filter->profile = DEFAULT_PROFILE; + filter->profile = g_strdup (DEFAULT_PROFILE); gst_faceblur_load_profile (filter); } @@ -196,6 +198,7 @@ gst_faceblur_set_property (GObject * object, guint prop_id, switch (prop_id) { case PROP_PROFILE: + g_free (filter->profile); filter->profile = g_value_dup_string (value); gst_faceblur_load_profile (filter); break; @@ -213,7 +216,7 @@ gst_faceblur_get_property (GObject * object, guint prop_id, switch (prop_id) { case PROP_PROFILE: - g_value_take_string (value, filter->profile); + g_value_set_string (value, filter->profile); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |