diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-10-16 18:06:56 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2018-10-17 10:13:32 +0200 |
commit | c76197ddbbd0c29adc2bceff2ee9f740f71d134d (patch) | |
tree | 6eab317dc5feeba8e9b6c7295d4f571260c34f8c /common/compat.c | |
parent | 8a8db182af533a43b4d478d28af8623035475d68 (diff) |
build: Call va_end() always when leaving the function
Diffstat (limited to 'common/compat.c')
-rw-r--r-- | common/compat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/compat.c b/common/compat.c index 5a9702d..48614fa 100644 --- a/common/compat.c +++ b/common/compat.c @@ -525,7 +525,10 @@ strconcat (const char *first, for (arg = first; arg; arg = va_arg (va, const char*)) { size_t old_length = length; length += strlen (arg); - return_val_if_fail (length >= old_length, NULL); + if (length < old_length) { + va_end (va); + return_val_if_reached (NULL); + } } va_end (va); |