mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Plug two memory leaks in error case.
MFC after: 1 month
This commit is contained in:
parent
bfd1f292d4
commit
80ca1f34b5
2 changed files with 5 additions and 2 deletions
|
|
@ -106,8 +106,10 @@ readdumptimes(FILE *df)
|
|||
|
||||
for (;;) {
|
||||
dtwalk = (struct dumptime *)calloc(1, sizeof (struct dumptime));
|
||||
if (getrecord(df, &(dtwalk->dt_value)) < 0)
|
||||
if (getrecord(df, &(dtwalk->dt_value)) < 0) {
|
||||
free(dtwalk);
|
||||
break;
|
||||
}
|
||||
nddates++;
|
||||
SLIST_INSERT_HEAD(&dthead, dtwalk, dt_list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -767,7 +767,8 @@ obsolete(int *argcp, char **argvp[])
|
|||
if (flags) {
|
||||
*p = '\0';
|
||||
*nargv++ = flagsp;
|
||||
}
|
||||
} else
|
||||
free(flagsp);
|
||||
|
||||
/* Copy remaining arguments. */
|
||||
while ((*nargv++ = *argv++));
|
||||
|
|
|
|||
Loading…
Reference in a new issue