From a677668418c9cf7b37d0ecf7fab81b4dc7be8ecb Mon Sep 17 00:00:00 2001 From: hasufell Date: Sat, 17 May 2014 14:18:58 +0200 Subject: [PATCH] Free obj_f_vt if we don't need it --- src/half_edge_AS.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/half_edge_AS.c b/src/half_edge_AS.c index d5ee313..0f821b2 100644 --- a/src/half_edge_AS.c +++ b/src/half_edge_AS.c @@ -157,7 +157,6 @@ static bool assemble_obj_arrays(char const * const obj_string, REALLOC(obj_f_v, sizeof(*obj_f_v) * (fc + 2)); obj_f_v[fc] = NULL; - /* TODO: deallocate if we don't have vertex textures */ REALLOC(obj_f_vt, sizeof(*obj_f_vt) * (fc + 2)); obj_f_vt[fc] = NULL; @@ -165,6 +164,8 @@ static bool assemble_obj_arrays(char const * const obj_string, /* is there a slash? */ if ((myint_vt = strtok_r(myint_v, "/", &str_ptr_slash))) myint_v = myint_vt; + else + free(obj_f_vt); /* seems there is no vt, free the array */ i++; ec++;