aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-01-17 16:51:55 +0100
committerAlexander Couzens <lynxis@fe80.eu>2021-01-19 19:33:41 +0100
commitea37724b3c7441a2ed8f24a7a6a80f8327d40345 (patch)
tree7178221ea0635c8900395a87ae66486460100343
parent55bc86931e96a8f0ffaef4dabc552c5f998f907f (diff)
gprs_ns2: allow to use free_vc() with NULL
Usually talloc_free() and other free functions in osmocom allows to be called with NULL which is then ignored. Change-Id: If7b0c6916a29d4611d0a40c388414076eb83e6b5
-rw-r--r--src/gb/gprs_ns2_fr.c3
-rw-r--r--src/gb/gprs_ns2_udp.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 7b9450c3..a7455d7c 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -101,7 +101,8 @@ struct priv_vc {
static void free_vc(struct gprs_ns2_vc *nsvc)
{
- OSMO_ASSERT(nsvc);
+ if (!nsvc)
+ return;
if (!nsvc->priv)
return;
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index 1037b197..2a335c11 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -73,6 +73,9 @@ static void free_bind(struct gprs_ns2_vc_bind *bind)
static void free_vc(struct gprs_ns2_vc *nsvc)
{
+ if (!nsvc)
+ return;
+
if (!nsvc->priv)
return;