From: David Schleef Date: Wed, 5 Jan 2011 20:59:48 +0000 (-0800) Subject: object: Fix creation of default name X-Git-Tag: RELEASE-0.10.32~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0534cc81c21be6a9a146cdd9e856b1a3856d0c0;p=platform%2Fupstream%2Fgstreamer.git object: Fix creation of default name Change the fixed allocation (!) to g_strdup_printf(). --- diff --git a/gst/gstobject.c b/gst/gstobject.c index b3aecb1..f06d798 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -641,11 +641,10 @@ gst_object_set_name_default (GstObject * object) type_name = g_quark_to_string (q); if (strncmp (type_name, "Gst", 3) == 0) type_name += 3; - l = strlen (type_name); - name = g_malloc (l + 6 + 1); + name = g_strdup_printf ("%s%d", type_name, count); + l = strlen (name); for (i = 0; i < l; i++) - name[i] = g_ascii_tolower (type_name[i]); - g_snprintf (&name[i], 6, "%d", count); + name[i] = g_ascii_tolower (name[i]); GST_OBJECT_LOCK (object); if (G_UNLIKELY (object->parent != NULL))