mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
main.c: Fix two potential memory leaks
Reported by: Coverity bug 1188048
This commit is contained in:
parent
735cc220e3
commit
7d5a7ef9ca
10
src/main.c
10
src/main.c
@ -875,7 +875,10 @@ format_and_print_line (const char *prefix, const char *line,
|
||||
line_dup = xstrdup (line);
|
||||
|
||||
if (printf ("%s", prefix) < 0)
|
||||
return -1;
|
||||
{
|
||||
xfree (line_dup);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Wrap to new line after prefix. */
|
||||
remaining_chars = 0;
|
||||
@ -903,7 +906,10 @@ format_and_print_line (const char *prefix, const char *line,
|
||||
}
|
||||
|
||||
if (printf ("\n") < 0)
|
||||
return -1;
|
||||
{
|
||||
xfree (line_dup);
|
||||
return -1;
|
||||
}
|
||||
|
||||
xfree (line_dup);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user