mgcp_internal: LOGPENDP: ensure *endp is not NULL
In certain cases the endp can be NULL. LOGPENDP will dereference the
pointer to retreive the endpoint number.
Fixes: 8a893442a1e9 ("mgcp_internal: LOGPENDP: ensure *endp is not NULL")
Change-Id: Ie9b5ecf08f69533ccb2fbd7fbbb529105e0c922f
diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h
index 24e28b4..82ff6c8 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -338,7 +338,7 @@
#define LOGPENDP(endp, cat, level, fmt, args...) \
LOGP(cat, level, "endpoint:0x%x " fmt, \
- ENDPOINT_NUMBER(endp), \
+ endp ? ENDPOINT_NUMBER(endp) : -1, \
## args)
#define LOGPCONN(conn, cat, level, fmt, args...) \