diff options
author | Matthew Waters <ystreet00@gmail.com> | 2014-03-04 23:28:01 +1100 |
---|---|---|
committer | Matthew Waters <ystreet00@gmail.com> | 2014-03-04 23:28:01 +1100 |
commit | b685a199ee520b81a7b90c34624df7888fa0f340 (patch) | |
tree | eb5501ef220518a2d3a8707754ffbb68a33d1d80 | |
parent | 5d4ef5ad886d6450b22d08dda8d5ab0171e1a1e0 (diff) |
api: plugin a small memory leak
Found by adrien.schwartzentruber@gmail.com
-rw-r--r-- | gst-libs/gst/gl/gstglapi.c | 9 |
1 files 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; } |