mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
fix leaks due to missing invocations of va_end
As the Linux man page states: "Each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function." Detected by cppcheck.
This commit is contained in:
parent
a17eb162ee
commit
e9d73f90a6
1 changed files with 5 additions and 0 deletions
|
@ -28,6 +28,9 @@ line_error (tag_parse_status_t status,
|
||||||
fprintf (stderr, status < 0 ? "Error: " : "Warning: ");
|
fprintf (stderr, status < 0 ? "Error: " : "Warning: ");
|
||||||
vfprintf (stderr, format, va_args);
|
vfprintf (stderr, format, va_args);
|
||||||
fprintf (stderr, " [%s]\n", line);
|
fprintf (stderr, " [%s]\n", line);
|
||||||
|
|
||||||
|
va_end (va_args);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,6 +203,8 @@ message_error (notmuch_message_t *message,
|
||||||
vfprintf (stderr, format, va_args);
|
vfprintf (stderr, format, va_args);
|
||||||
fprintf (stderr, "Message-ID: %s\n", notmuch_message_get_message_id (message));
|
fprintf (stderr, "Message-ID: %s\n", notmuch_message_get_message_id (message));
|
||||||
fprintf (stderr, "Status: %s\n", notmuch_status_to_string (status));
|
fprintf (stderr, "Status: %s\n", notmuch_status_to_string (status));
|
||||||
|
|
||||||
|
va_end (va_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in a new issue