aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-06-23 17:39:08 (GMT)
committerJouni Malinen <j@w1.fi>2015-06-23 17:39:08 (GMT)
commitba54933f63b6ececde3e1a85bb5149fd59b22f6e (patch)
tree8789a129161ecad45514ebdcbb9e2eb369484a24 /src/tls
parentf6332b0be1d5e1b75ec834c64a67750aa00965ab (diff)
downloadhostap-ba54933f63b6ececde3e1a85bb5149fd59b22f6e.zip
hostap-ba54933f63b6ececde3e1a85bb5149fd59b22f6e.tar.gz
hostap-ba54933f63b6ececde3e1a85bb5149fd59b22f6e.tar.bz2
libtommath: Fix mp_init_multi() stdarg use on error path
Previously, it would have been possible for va_end(args) to be called twice in case mp_init() fails. While that may not cause issues on number of platforms, that is not how va_start()/va_end() are supposed to be used. Fix this by returning from the function without using va_end() twice on the same va_list args. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/tls')
-rw-r--r--src/tls/libtommath.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tls/libtommath.c b/src/tls/libtommath.c
index 251133e..8bc824f 100644
--- a/src/tls/libtommath.c
+++ b/src/tls/libtommath.c
@@ -1472,8 +1472,7 @@ static int mp_init_multi(mp_int *mp, ...)
cur_arg = va_arg(clean_args, mp_int*);
}
va_end(clean_args);
- res = MP_MEM;
- break;
+ return MP_MEM;
}
n++;
cur_arg = va_arg(args, mp_int*);