ifcfg: make Coverity happy

CID 59382 (#1 of 1): Dereference null return value (NULL_RETURNS)
10.  dereference: Dereferencing a pointer that might be null value
when calling strcmp.

Not exactly true, since we ruled out the posibility earlier; but
we could still get rid of a couple of strcmps.
This commit is contained in:
Lubomir Rintel 2016-01-29 09:45:35 +01:00
parent 301c747938
commit a77ec45110

View file

@ -3148,8 +3148,7 @@ make_wpa_setting (shvarFile *ifcfg,
g_free (allow_rsn);
}
/* coverity[dereference] */
if (!strcmp (value, "WPA-PSK")) {
if (wpa_psk) {
NMSettingSecretFlags psk_flags;
psk_flags = read_secret_flags (ifcfg, "WPA_PSK_FLAGS");
@ -3169,7 +3168,7 @@ make_wpa_setting (shvarFile *ifcfg,
g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-none", NULL);
else
g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", NULL);
} else if (!strcmp (value, "WPA-EAP") || !strcmp (value, "IEEE8021X")) {
} else if (wpa_eap || ieee8021x) {
/* Adhoc mode is mutually exclusive with any 802.1x-based authentication */
if (adhoc) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,