Signed-off-by: Selva Nair <selva.n...@gmail.com> --- src/openvpnserv/interactive.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index d83ea65..5ff80fa 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -1326,15 +1326,19 @@ UpdateWaitHandles (LPHANDLE *handles_ptr, LPDWORD count, if (pos == size) { size += 10; - handles = realloc (handles, size * sizeof (HANDLE)); - if (handles == NULL) + LPHANDLE tmp = realloc (handles, size * sizeof (HANDLE)); + if (tmp == NULL) return ERROR_OUTOFMEMORY; + else + { + handles = tmp; + *handles_ptr = handles; + } } handles[pos++] = threads->data; threads = threads->next; } - *handles_ptr = handles; *count = pos; return NO_ERROR; } -- 1.7.10.4