Skip to contentSkip to conversation

adhoc: fix missing call to va_end

PATCH Applied James Prestwood 2 participants 2 messages Feb 8, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 adhoc: fix missing call to va_end

Since only one switch case uses this, va_start/end were just moved into that case specifically.

---
 src/adhoc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
src/adhoc.c +3 -2
index 7f9ce765..506e596a 100644
@@ -186,14 +186,15 @@ static void adhoc_handshake_event(struct handshake_state *hs,
 	struct adhoc_state *adhoc = sta->adhoc;
 	va_list args;
 
-	va_start(args, user_data);
-
 	switch (event) {
 	case HANDSHAKE_EVENT_FAILED:
+		va_start(args, user_data);
+
 		l_error("handshake failed with STA "MAC" (%d)",
 						MAC_STR(sta->addr),
 						va_arg(args, int));
 
+		va_end(args);
 		/*
 		 * eapol frees the state machines upon handshake failure. Since
 		 * this is only a failure on one of the handshakes we need to
Signature · 1 line
2.26.2
#1 lore raw

Hi James,

Quoted 6 lines · James Prestwood

Since only one switch case uses this, va_start/end were just moved into that case specifically.

---
  src/adhoc.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Regards,
-Denis