Since there is a special case with a call to
radius_server_free_clients() using data == NULL for a parsing failure,
radius_server_session_free() should check that data is set before
dereferencing it. It does not look like this case would be reachable in
practice, though, since this would require there to be an ongoing RADIUS
session which cannot really be established without the client
configuration file having been successfully parsed.
Signed-off-by: Meng Yuan <menyua@qti.qualcomm.com>
os_free(sess->username);
os_free(sess->nas_ip);
os_free(sess);
- data->num_sess--;
+ if (data)
+ data->num_sess--;
}