diff options
-rw-r--r-- | lib/strutils.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/strutils.c b/lib/strutils.c index b033f7592..30dc090b4 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); |