gl: android: fix memory leak and error code
authorZhao Zhili <quinkblack@foxmail.com>
Thu, 17 May 2018 12:22:29 +0000 (20:22 +0800)
committerThomas Guillem <thomas@gllm.fr>
Fri, 18 May 2018 11:27:38 +0000 (13:27 +0200)
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
modules/video_output/opengl/converter_android.c

index ad0265f..2e89544 100644 (file)
@@ -264,7 +264,10 @@ Open(vlc_object_t *obj)
 
     char *code;
     if (asprintf(&code, template, tc->glsl_version, tc->glsl_precision_header) < 0)
-        return 0;
+    {
+        free(tc->priv);
+        return VLC_EGENERIC;
+    }
     GLuint fragment_shader = tc->vt->CreateShader(GL_FRAGMENT_SHADER);
     tc->vt->ShaderSource(fragment_shader, 1, (const char **) &code, NULL);
     tc->vt->CompileShader(fragment_shader);