]> sourceware.org Git - lvm2.git/commitdiff
Move va_end() so it is also used before error path return
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 23 Nov 2010 15:08:57 +0000 (15:08 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 23 Nov 2010 15:08:57 +0000 (15:08 +0000)
lib/config/config.c

index 2b386634a5a8c6c151955118093d6e370d83100c..c10c78ec697c82ebb2498b290426eb6ff1413496 100644 (file)
@@ -381,11 +381,12 @@ static int _line_append(struct output_line *outline, const char *fmt, ...)
 
        va_start(ap, fmt);
        n = vsnprintf(&buf[0], sizeof buf - 1, fmt, ap);
+       va_end(ap);
+
        if (n < 0 || n > (int) sizeof buf - 1) {
                log_error("vsnprintf failed for config line");
                return 0;
        }
-       va_end(ap);
 
        if (!dm_pool_grow_object(outline->mem, &buf[0], strlen(buf))) {
                log_error("dm_pool_grow_object failed for config line");
This page took 0.030365 seconds and 5 git commands to generate.