glshader: Fix memory leak
Memory is only freed in the TRUE clause of the if conditional. Free in the else clause as well. Also, consolidate g_malloc + sprintf into a g_strdup_printf(). CID #1212171 https://bugzilla.gnome.org/show_bug.cgi?id=739368
This commit is contained in:
parent
eabcf66f2f
commit
f16b75aa49
@ -254,12 +254,12 @@ gst_gl_shadervariables_parse (GstGLShader * shader, char *variables,
|
|||||||
trimright (t, " \t");
|
trimright (t, " \t");
|
||||||
|
|
||||||
if (arraysize) {
|
if (arraysize) {
|
||||||
char *s = g_malloc (strlen (vartype) + 32);
|
gchar *s = g_strdup_printf ("%s[%d]", vartype, arraysize);
|
||||||
sprintf (s, "%s[%d]", vartype, arraysize);
|
|
||||||
if (strcmp (t, s)) {
|
if (strcmp (t, s)) {
|
||||||
g_free (s);
|
g_free (s);
|
||||||
goto parse_error;
|
goto parse_error;
|
||||||
}
|
}
|
||||||
|
g_free (s);
|
||||||
} else {
|
} else {
|
||||||
if (strcmp (t, vartype))
|
if (strcmp (t, vartype))
|
||||||
goto parse_error;
|
goto parse_error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user