]> granicus.if.org Git - postgresql/commitdiff
Add missing va_end() call to a early exit in dmetaphone.c's StringAt().
authorAndres Freund <andres@anarazel.de>
Sun, 4 Jan 2015 14:35:48 +0000 (15:35 +0100)
committerAndres Freund <andres@anarazel.de>
Sun, 4 Jan 2015 14:35:48 +0000 (15:35 +0100)
Pointed out by Coverity.

Backpatch to all supported branches, the code has been that way for a
long while.

contrib/fuzzystrmatch/dmetaphone.c

index f23a3a2aa6d7bd5d510503bbdc069ee061be1bc4..b128c2d9036e41f35d1ed41ce625e38022438c11 100644 (file)
@@ -362,7 +362,10 @@ StringAt(metastring *s, int start, int length,...)
        {
                test = va_arg(ap, char *);
                if (*test && (strncmp(pos, test, length) == 0))
+               {
+                       va_end(ap);
                        return 1;
+               }
        }
        while (strcmp(test, ""));