Free obj_f_vt if we don't need it

This commit is contained in:
hasufell 2014-05-17 14:18:58 +02:00
parent 01a214aa01
commit a677668418
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 2 additions and 1 deletions

View File

@ -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++;