Fix a few memory leaks in the tests.
This commit is contained in:
@@ -74,7 +74,6 @@ main(int argc, char *argv[])
|
||||
|
||||
for (td = test_data; td->input != NULL; td++) {
|
||||
ntests++;
|
||||
free(path);
|
||||
if ((path = strdup(td->input)) == NULL)
|
||||
sudo_fatal(NULL);
|
||||
result = expand_tilde(&path, td->user);
|
||||
@@ -86,14 +85,12 @@ main(int argc, char *argv[])
|
||||
} else {
|
||||
sudo_warnx("unexpected failure: input %s", td->input);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (td->result && strcmp(path, td->output) != 0) {
|
||||
} else if (td->result && strcmp(path, td->output) != 0) {
|
||||
errors++;
|
||||
sudo_warnx("incorrect output for input %s: expected %s, got %s",
|
||||
td->input, td->output, path);
|
||||
continue;
|
||||
}
|
||||
free(path);
|
||||
}
|
||||
|
||||
if (ntests != 0) {
|
||||
|
@@ -295,6 +295,7 @@ main(int argc, char *argv[])
|
||||
if (get_net_ifs(&p) > 0) {
|
||||
if (!set_interfaces(p))
|
||||
sudo_fatal("%s", U_("unable to parse network address list"));
|
||||
free(p);
|
||||
}
|
||||
|
||||
/* Initialize the parser and set sudoers filename to "sudoers". */
|
||||
|
Reference in New Issue
Block a user