]> 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:46 +0000 (15:35 +0100)
committerAndres Freund <andres@anarazel.de>
Sun, 4 Jan 2015 14:35:46 +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 5001288bb6424416c8c0b2fc5ea5d49b4aeeb22f..dcbc7782d4567661574ae319ea59a8c43b21ca52 100644 (file)
@@ -359,7 +359,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, "") != 0);