make osmo_cni_peer_id_cmp() NULL safe
Related: coverity CID#210172 Change-Id: I400b23ac3f0eb68d5e4c757ea02d130fbe12f80b
This commit is contained in:
parent
a450a85956
commit
3e79a38440
|
@ -154,6 +154,12 @@ int osmo_cni_peer_id_set_str(struct osmo_cni_peer_id *cni_peer_id, enum osmo_cni
|
|||
|
||||
int osmo_cni_peer_id_cmp(const struct osmo_cni_peer_id *a, const struct osmo_cni_peer_id *b)
|
||||
{
|
||||
if (a == b)
|
||||
return 0;
|
||||
if (!a)
|
||||
return -1;
|
||||
if (!b)
|
||||
return 1;
|
||||
if (a->type != b->type)
|
||||
return OSMO_CMP(a->type, b->type);
|
||||
switch (a->type) {
|
||||
|
|
Loading…
Reference in New Issue