Free allocated memory on clean exit

This commit is contained in:
Pierre Pronchery 2009-07-29 13:36:53 +00:00
parent 4471ed3446
commit 43dd5ac499

View File

@ -133,16 +133,20 @@ int main(int argc, char * argv[])
return _usage();
}
if(optind == argc)
return _usage();
if(prefs.flags & C99PREFS_c
ret = _usage();
else if(prefs.flags & C99PREFS_c
&& prefs.outfile != NULL
&& optind + 1 != argc)
return _usage();
ret = _c99(&prefs, argc - optind, &argv[optind]);
ret = _usage();
else
{
ret = _c99(&prefs, argc - optind, &argv[optind]);
ret = (ret == 0) ? 0 : 2;
}
free(prefs.paths);
free(prefs.defines);
free(prefs.undefines);
return (ret == 0) ? 0 : 2;
return ret;
}
static int _main_default_defines(C99Prefs * prefs)