From 58bc4747be26f6849ca38e67e24abdd6aecba3b1 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sun, 4 Jan 2015 15:35:46 +0100
Subject: [PATCH] Add missing va_end() call to a early exit in dmetaphone.c's
 StringAt().

Pointed out by Coverity.

Backpatch to all supported branches, the code has been that way for a
long while.
---
 contrib/fuzzystrmatch/dmetaphone.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/contrib/fuzzystrmatch/dmetaphone.c b/contrib/fuzzystrmatch/dmetaphone.c
index c8f5f32fbbf..b1f8b78d3be 100644
--- a/contrib/fuzzystrmatch/dmetaphone.c
+++ b/contrib/fuzzystrmatch/dmetaphone.c
@@ -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);
 
-- 
GitLab