laforge has submitted this change. (
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(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
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(>i->wq.bfd);
osmo_wqueue_clear(>i->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: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged