1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmetad: move initialization in the inner loop

Set append to NULL in the front of cycle, so the INTERNAL error path
is not leading to double-free of append pointer.
This commit is contained in:
Zdenek Kabelac 2012-10-13 19:15:15 +02:00
parent 7c7ab99843
commit 88c547d1ca

View File

@ -23,7 +23,7 @@
int buffer_append_vf(struct buffer *buf, va_list ap)
{
char *append = NULL;
char *append;
char *next;
int keylen;
int64_t value;
@ -31,6 +31,7 @@ int buffer_append_vf(struct buffer *buf, va_list ap)
char *block;
while ((next = va_arg(ap, char *))) {
append = NULL;
if (!strchr(next, '=')) {
log_error(INTERNAL_ERROR "Bad format string at '%s'", next);
goto fail;