laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/33531 )


Change subject: gsmtap_source_free(): Don't crash if NULL is passed
......................................................................

gsmtap_source_free(): Don't crash if NULL is passed

A function called *free() should always support passing a NULL input
value.

Change-Id: If0f6c11ac6ad987368e1d5c63a07fc456f89db2a
---
M src/core/gsmtap_util.c
1 file changed, 15 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/33531/1

diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index a95c795..20c0ce1 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -531,6 +531,9 @@

 void gsmtap_source_free(struct gsmtap_inst *gti)
 {
+       if (!gti)
+               return;
+
        if (gti->ofd_wq_mode) {
                osmo_fd_unregister(&gti->wq.bfd);
                osmo_wqueue_clear(&gti->wq);

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If0f6c11ac6ad987368e1d5c63a07fc456f89db2a
Gerrit-Change-Number: 33531
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to