Fix memory leaks on radius_client_send error paths

In case this function returns an error, the RADIUS message needs to
freed in the caller.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2012-04-01 17:55:20 +03:00
parent 8c6f80e023
commit ca8e039fec
4 changed files with 16 additions and 9 deletions

View file

@ -88,7 +88,8 @@ static void start_example(void *eloop_ctx, void *timeout_ctx)
return;
}
radius_client_send(ctx->radius, msg, RADIUS_AUTH, NULL);
if (radius_client_send(ctx->radius, msg, RADIUS_AUTH, NULL) < 0)
radius_msg_free(msg);
}