A possible fix for the memory leak reported by valgrind when running tcctest.c with tcc.

This commit is contained in:
mingodad 2014-03-25 18:06:14 +00:00
parent dc8ea93b13
commit ad9568060e
2 changed files with 3 additions and 0 deletions

View File

@ -1094,6 +1094,8 @@ LIBTCCAPI void tcc_delete(TCCState *s1)
# endif
#endif
if(s1->sym_attrs) tcc_free(s1->sym_attrs);
tcc_free(s1);
}

View File

@ -2444,6 +2444,7 @@ static int elf_output_file(TCCState *s1, const char *filename)
tcc_free(sec_order);
tcc_free(phdr);
tcc_free(s1->sym_attrs);
s1->sym_attrs = NULL;
return ret;
}