]> 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:47 +0000 (15:35 +0100)
committerAndres Freund <andres@anarazel.de>
Sun, 4 Jan 2015 14:35:47 +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 f562f5484cc83114089d85a7ba7f34611b56726e..a415bbb292f33b1fd17bc4a3a241ffb6f695c805 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, "") != 0);