commit 8efa94bbe3e439a488a6c5d22e28f4ab29fbf3c0
parent 2f6166208b9f82d3b089eaa262ad949de81d0f3a
Author: amin <dev@aminmesbah.com>
Date: Mon, 1 Apr 2019 06:56:46 +0000
Fix memory leak
FossilOrigin-Name: ed6aa7338539b5e0938a1d71ddcb5d89e95219faefae549e1880d37ac08b0c2a
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/shader.c b/src/shader.c
@@ -144,7 +144,9 @@ void shader_setm4(struct Shader *s, char *name, m4 *mat)
{
if (s)
{
- glUniformMatrix4fv(glGetUniformLocation(s->program, name), 1, GL_TRUE, glmth_m4_valueptr(*mat));
+ f32* valueptr = glmth_m4_valueptr(*mat);
+ glUniformMatrix4fv(glGetUniformLocation(s->program, name), 1, GL_TRUE, valueptr);
+ free(valueptr);
}
else
{