From 105cfa62fc4a2e2e2f319208749d2d6f51f47f7a Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 4 Mar 2014 23:28:01 +1100 Subject: [PATCH] [897/906] api: plugin a small memory leak Found by adrien.schwartzentruber@gmail.com --- gst-libs/gst/gl/gstglapi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/gl/gstglapi.c b/gst-libs/gst/gl/gstglapi.c index c67567234b..c86b398d9e 100644 --- a/gst-libs/gst/gl/gstglapi.c +++ b/gst-libs/gst/gl/gstglapi.c @@ -38,10 +38,10 @@ gst_gl_api_to_string (GstGLAPI api) if (api == GST_GL_API_NONE) { str = g_string_new ("none"); - return str->str; + goto out; } else if (api == GST_GL_API_ANY) { str = g_string_new ("any"); - return str->str; + goto out; } if (api & GST_GL_API_OPENGL) { @@ -76,8 +76,11 @@ gst_gl_api_to_string (GstGLAPI api) } } - ret = g_string_free (str, FALSE); +out: + if (!str) + return "unknown"; + ret = g_string_free (str, FALSE); return ret; }