sudo_warnx("%s: expected %s, got %s", file_in, file_out, slash + 1);
error = 1;
}
+ free(path);
return error;
}
sudo_fatalx("group ID %s: %s", line, errstr);
break;
case 5:
+ if (user_shost != NULL)
+ free(user_shost);
user_shost = strdup(line);
break;
case 6:
+ if (user_base != NULL)
+ free(user_base);
user_base = strdup(line);
break;
case 7:
+ if (dir_in != NULL)
+ free(dir_in);
dir_in = strdup(line);
break;
case 8:
+ if (file_in != NULL)
+ free(file_in);
file_in = strdup(line);
break;
case 9:
+ if (dir_out != NULL)
+ free(dir_out);
dir_out = strdup(line);
break;
case 10:
+ if (file_out != NULL)
+ free(file_out);
file_out = strdup(line);
break;
case 11:
static int
check_fill(const char *input, int len, int addspace, const char *expect, char **resultp)
{
+ if (sudoerslval.string != NULL) {
+ free(sudoerslval.string);
+ sudoerslval.string = NULL;
+ }
if (!fill(input, len))
return -1;
*resultp = sudoerslval.string;
static int
check_fill_cmnd(const char *input, int len, int addspace, const char *expect, char **resultp)
{
+ if (sudoerslval.command.cmnd != NULL) {
+ free(sudoerslval.command.cmnd);
+ sudoerslval.command.cmnd = NULL;
+ }
if (!fill_cmnd(input, len))
return -1;
*resultp = sudoerslval.command.cmnd;
static int
check_fill_args(const char *input, int len, int addspace, const char *expect, char **resultp)
{
+ /* Must not free old sudoerslval.command.args as gets appended to. */
if (!fill_args(input, len, addspace))
return -1;
*resultp = sudoerslval.command.args;