From e64051fd1f1576ea9039727978e11f93b21f5502 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 c675672..c86b398 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; } -- 2.7.4