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);