Check eap_get_name() return against NULL to silence static analyzer

This cannot really be NULL in practice since cred->eap_method would
point to a valid EAP method. Anyway, to avoid false positive from
analyzers, check the pointer explicitly before printing it.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-06-07 15:42:07 +03:00
parent bc32bb70d7
commit f2ca0e9770

View file

@ -790,6 +790,7 @@ static void wpa_config_write_cred(FILE *f, struct wpa_cred *cred)
const char *name;
name = eap_get_name(cred->eap_method[0].vendor,
cred->eap_method[0].method);
if (name)
fprintf(f, "\teap=%s\n", name);
}
if (cred->phase1)