aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2015-05-12 10:58:04 +0300
committerseyko <seyko2@gmail.com>2015-05-12 10:58:04 +0300
commita98fd1309076ad97c672394831034fe393b39121 (patch)
tree8d8d638519519d476b93f158f857c1e1ae3fffac /tcc.c
parentae09051c815e115b3c37abeb9ff4a27832770e9e (diff)
downloadtinycc-a98fd1309076ad97c672394831034fe393b39121.tar.gz
tinycc-a98fd1309076ad97c672394831034fe393b39121.tar.bz2
a mem leak fix for "ability to compile multiple *.c files with -c switch"
A new version of the MEM_DEBUG will be submitted next. This version is not depend on the malloc_usable_size() presense in the libc and print a places where a leaked chunks of memory was allocated.
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tcc.c b/tcc.c
index 7ef927e..e499100 100644
--- a/tcc.c
+++ b/tcc.c
@@ -319,14 +319,13 @@ int main(int argc, char **argv)
ret = 1;
else
if (s->output_type == TCC_OUTPUT_OBJ) {
- const char *outfile = s->outfile;
- if (!outfile)
- outfile = default_outputfile(s, filename);
- ret = !!tcc_output_file(s, outfile);
+ if (!s->outfile)
+ s->outfile = default_outputfile(s, filename);
+ ret = !!tcc_output_file(s, s->outfile);
if (!ret) {
/* dump collected dependencies */
if (s->gen_deps)
- gen_makedeps(s, outfile, s->deps_outfile);
+ gen_makedeps(s, s->outfile, s->deps_outfile);
if ((i+1) < s->nb_files) {
tcc_delete(s);
s = tcc_new();