src/devices/nm-device.c: resolve possible null pointer dereference

found by cppcheck

[src/devices/nm-device.c:3032] -> [src/devices/nm-device.c:3025]: (warning) Either the condition '!handle' is redundant or there is possible null pointer dereference: handle.

https://github.com/NetworkManager/NetworkManager/pull/352
This commit is contained in:
Ilya Shipitsin 2019-10-03 17:02:07 +05:00 committed by Thomas Haller
parent adac530d7a
commit e8588d0c6f

View file

@ -3021,15 +3021,15 @@ concheck_cb (NMConnectivity *connectivity,
self_keep_alive = g_object_ref (self);
/* keep @self alive, while we invoke callbacks. */
priv = NM_DEVICE_GET_PRIVATE (self);
_LOGT (LOGD_CONCHECK, "connectivity: [Ipv%c] complete check (seq:%llu, state:%s)",
nm_utils_addr_family_to_char (handle->addr_family),
(long long unsigned) handle->seq,
nm_connectivity_state_to_string (state));
/* keep @self alive, while we invoke callbacks. */
priv = NM_DEVICE_GET_PRIVATE (self);
nm_assert (!handle || c_list_contains (&priv->concheck_lst_head, &handle->concheck_lst));
nm_assert (handle && c_list_contains (&priv->concheck_lst_head, &handle->concheck_lst));
seq = handle->seq;