Let's try -fanalyzer.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4431 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-08-25 20:57:55 +00:00
parent dcea08f73b
commit daeb88785d
7 changed files with 48 additions and 41 deletions

View File

@ -151,10 +151,6 @@ static int _tf_command_test(const char* file, int argc, char* argv[])
int extra_count = 0;
const char *err = NULL;
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "test [options]", "options:", NULL, 15);
if (extras)
{
free((void*)extras);
}
if (err)
{
fprintf(stderr, "Error: %s\n", err);
@ -167,6 +163,10 @@ static int _tf_command_test(const char* file, int argc, char* argv[])
.tests = args.tests,
};
tf_tests(&test_options);
if (extras)
{
free((void*)extras);
}
return 0;
xopt_help:
if (extras)
@ -197,7 +197,6 @@ static int _tf_command_import(const char* file, int argc, char* argv[])
int extra_count = 0;
const char *err = NULL;
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "import [options] [paths] ...", "options:", NULL, 15);
if (err)
{
fprintf(stderr, "Error: %s\n", err);
@ -258,14 +257,9 @@ static int _tf_command_export(const char* file, int argc, char* argv[])
int extra_count = 0;
const char *err = NULL;
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "export [options] [paths] ...", "options:", NULL, 15);
if (err)
{
fprintf(stderr, "Error: %s\n", err);
if (extras)
{
free((void*)extras);
}
return 2;
}
tf_ssb_t* ssb = tf_ssb_create(NULL, NULL, args.db_path);
@ -409,16 +403,8 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
if (err)
{
fprintf(stderr, "Error: %s\n", err);
if (extras)
{
free((void*)extras);
}
return 2;
}
if (extras)
{
free((void*)extras);
}
int result = 0;
#if !defined(_WIN32) && !defined(__MACH__)
@ -454,6 +440,10 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
tf_free(threads);
}
if (extras)
{
free((void*)extras);
}
return result;
xopt_help:
@ -481,20 +471,11 @@ static int _tf_command_sandbox(const char* file, int argc, char* argv[])
int extra_count = 0;
const char *err = NULL;
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "sandbox [options]", "options:", NULL, 15);
if (err)
{
fprintf(stderr, "Error: %s\n", err);
if (extras)
{
free((void*)extras);
}
return 2;
}
if (extras)
{
free((void*)extras);
}
#if !defined(_WIN32) && !defined(__MACH__)
prctl(PR_SET_PDEATHSIG, SIGHUP);
@ -505,6 +486,10 @@ static int _tf_command_sandbox(const char* file, int argc, char* argv[])
/* The caller will trigger tf_task_activate with a message. */
tf_task_run(task);
tf_task_destroy(task);
if (extras)
{
free((void*)extras);
}
return 0;
xopt_help:
@ -533,10 +518,6 @@ static int _tf_command_check(const char* file, int argc, char* argv[])
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "check [options]", "options:", NULL, 15);
if (err)
{
if (extras)
{
free((void*)extras);
}
fprintf(stderr, "Error: %s\n", err);
return 2;
}