ximagesink, xvimagesink: fix string leaks when setting class hint
authorTim-Philipp Müller <tim@centricular.com>
Mon, 8 Jun 2015 19:17:07 +0000 (20:17 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 8 Jun 2015 19:19:42 +0000 (20:19 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=750455

sys/ximage/ximagesink.c
sys/xvimage/xvcontext.c

index 328a617..126e3cb 100644 (file)
@@ -406,8 +406,8 @@ gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
       }
 
       if (hint) {
-        hint->res_name = g_strdup (app_name);
-        hint->res_class = g_strdup ("GStreamer");
+        hint->res_name = (char *) app_name;
+        hint->res_class = (char *) "GStreamer";
         XSetClassHint (ximagesink->xcontext->disp, xwindow->win, hint);
       }
       XFree (hint);
index b04a49c..1af70b2 100644 (file)
@@ -1087,8 +1087,8 @@ gst_xwindow_set_title (GstXWindow * window, const gchar * title)
       XFree (xproperty.value);
 
       if (hint) {
-        hint->res_name = g_strdup (title);
-        hint->res_class = g_strdup ("GStreamer");
+        hint->res_name = (char *) title;
+        hint->res_class = (char *) "GStreamer";
         XSetClassHint (context->disp, window->win, hint);
       }
       XFree (hint);