lynxis lazus has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/22274 )

Change subject: gprs_ns2: allow to use free_vc() with NULL
......................................................................

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
---
M src/gb/gprs_ns2_fr.c
M src/gb/gprs_ns2_udp.c
2 files changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  daniel: Looks good to me, approved



diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 7b9450c..a7455d7 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -101,7 +101,8 @@

 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 1037b19..2a335c1 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -73,6 +73,9 @@

 static void free_vc(struct gprs_ns2_vc *nsvc)
 {
+       if (!nsvc)
+               return;
+
        if (!nsvc->priv)
                return;


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22274
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If7b0c6916a29d4611d0a40c388414076eb83e6b5
Gerrit-Change-Number: 22274
Gerrit-PatchSet: 12
Gerrit-Owner: lynxis lazus <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to