static void hostapd_acl_query_free(struct hostapd_acl_query_data *query)
{
- if (query == NULL)
+ if (!query)
return;
os_free(query->auth_msg);
os_free(query);
query->radius_id = radius_client_get_id(hapd->radius);
msg = radius_msg_new(RADIUS_CODE_ACCESS_REQUEST, query->radius_id);
- if (msg == NULL)
+ if (!msg)
return -1;
if (radius_msg_make_authenticator(msg) < 0) {
/* No entry in the cache - query external RADIUS server */
query = os_zalloc(sizeof(*query));
- if (query == NULL) {
+ if (!query) {
wpa_printf(MSG_ERROR, "malloc for query data failed");
return HOSTAPD_ACL_REJECT;
}
}
query->auth_msg = os_memdup(msg, len);
- if (query->auth_msg == NULL) {
+ if (!query->auth_msg) {
wpa_printf(MSG_ERROR,
"Failed to allocate memory for auth frame.");
hostapd_acl_query_free(query);
* Passphrase is NULL iff there is no i-th Tunnel-Password
* attribute in msg.
*/
- if (passphrase == NULL)
+ if (!passphrase)
break;
/*
prev = query;
query = query->next;
}
- if (query == NULL)
+ if (!query)
return RADIUS_RX_UNKNOWN;
wpa_printf(MSG_DEBUG,
/* Insert Accept/Reject info into ACL cache */
cache = os_zalloc(sizeof(*cache));
- if (cache == NULL) {
+ if (!cache) {
wpa_printf(MSG_DEBUG, "Failed to add ACL cache entry");
goto done;
}
}
done:
- if (prev == NULL)
+ if (!prev)
hapd->acl_queries = query->next;
else
prev->next = query->next;