Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH 1/2] lib/strutil: fix parse_switch resource leak [coverity scan]
@ 2015-08-25 16:27 Andreas Henriksson
  2015-08-25 16:27 ` [PATCH 2/2] lsblk: fix " Andreas Henriksson
  2015-08-31  8:11 ` [PATCH 1/2] lib/strutil: fix parse_switch " Karel Zak
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Henriksson @ 2015-08-25 16:27 UTC (permalink / raw)
  To: util-linux; +Cc: Andreas Henriksson

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 lib/strutils.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/strutils.c b/lib/strutils.c
index b033f75..30dc090 100644
--- a/lib/strutils.c
+++ b/lib/strutils.c
@@ -198,10 +198,13 @@ int parse_switch(const char *arg, const char *errmesg, ...)
 		if (!b)
 			break;
 
-		if (strcmp(arg, a) == 0)
+		if (strcmp(arg, a) == 0) {
+			va_end(ap);
 			return 1;
-		else if (strcmp(arg, b) == 0)
+		} else if (strcmp(arg, b) == 0) {
+			va_end(ap);
 			return 0;
+		}
 	} while (1);
 	va_end(ap);
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-31  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-25 16:27 [PATCH 1/2] lib/strutil: fix parse_switch resource leak [coverity scan] Andreas Henriksson
2015-08-25 16:27 ` [PATCH 2/2] lsblk: fix " Andreas Henriksson
2015-08-31  8:11 ` [PATCH 1/2] lib/strutil: fix parse_switch " Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox