History

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

mingodad committed 12 years ago

Commit ad956801 parent dc8ea932 files · +3 −0Browse files

Unified · Split

2 files
  1. libtcc.c +2 −0
  2. tccelf.c +1 −0
libtcc.c+2−0
@@ -1094,6 +1094,8 @@ LIBTCCAPI void tcc_delete(TCCState *s1) · 1093 unmodified lines
1094# endif1094# endif
1095#endif1095#endif
1096 1096
1097 if(s1->sym_attrs) tcc_free(s1->sym_attrs);
1098
1097 tcc_free(s1);1099 tcc_free(s1);
1098}1100}
1099 1101
tccelf.c+1−0
@@ -2444,6 +2444,7 @@ static int elf_output_file(TCCState *s1, const char *filename) · 2443 unmodified lines
2444 tcc_free(sec_order);2444 tcc_free(sec_order);
2445 tcc_free(phdr);2445 tcc_free(phdr);
2446 tcc_free(s1->sym_attrs);2446 tcc_free(s1->sym_attrs);
2447 s1->sym_attrs = NULL;
2447 return ret;2448 return ret;
2448}2449}
2449 2450