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>
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*);