summaryrefslogtreecommitdiffstats
path: root/tag-util.c
diff options
context:
space:
mode:
authorPiotr Trojanek <piotr.trojanek@gmail.com>2017-06-16 23:50:23 +0100
committerDavid Bremner <david@tethera.net>2017-06-25 09:35:23 -0300
commite9d73f90a6d3945b7ebda9d95ec719e0ba0c9756 (patch)
treec00baaa10d33598419934c7415c4cc4f2758ceaa /tag-util.c
parenta17eb162ee15e41366ca327250c3935da2df80ed (diff)
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.
Diffstat (limited to 'tag-util.c')
-rw-r--r--tag-util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tag-util.c b/tag-util.c
index 7091d294..30c2c077 100644
--- a/tag-util.c
+++ b/tag-util.c
@@ -28,6 +28,9 @@ line_error (tag_parse_status_t status,
fprintf (stderr, status < 0 ? "Error: " : "Warning: ");
vfprintf (stderr, format, va_args);
fprintf (stderr, " [%s]\n", line);
+
+ va_end (va_args);
+
return status;
}
@@ -200,6 +203,8 @@ message_error (notmuch_message_t *message,
vfprintf (stderr, format, va_args);
fprintf (stderr, "Message-ID: %s\n", notmuch_message_get_message_id (message));
fprintf (stderr, "Status: %s\n", notmuch_status_to_string (status));
+
+ va_end (va_args);
}
static int