xtensa: ISS: add missing va_end into split_if_spec
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 13 Jul 2015 12:42:00 +0000 (15:42 +0300)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 13 Jul 2015 12:42:00 +0000 (15:42 +0300)
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/platforms/iss/network.c

index 8ab021b1f14128d49948de51f685a78fd7180fa2..976a3859453707b5d2acaa1e7f80b0e81a16a74e 100644 (file)
@@ -105,13 +105,17 @@ static char *split_if_spec(char *str, ...)
 
        va_start(ap, str);
        while ((arg = va_arg(ap, char**)) != NULL) {
-               if (*str == '\0')
+               if (*str == '\0') {
+                       va_end(ap);
                        return NULL;
+               }
                end = strchr(str, ',');
                if (end != str)
                        *arg = str;
-               if (end == NULL)
+               if (end == NULL) {
+                       va_end(ap);
                        return NULL;
+               }
                *end++ = '\0';
                str = end;
        }