tbf: Fix dereference before null check
m_new_tbf might be NULL. Assign was_releasing _after_ we have
done the NULL check.
Related: Coverity CID#1238847
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 2afe257..680a096 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -565,7 +565,6 @@
}
new_dl_tbf = static_cast<gprs_rlcmac_dl_tbf *>(m_new_tbf);
- new_dl_tbf->was_releasing = was_releasing;
if (!new_dl_tbf) {
LOGP(DRLCMACDL, LOGL_ERROR, "We have a schedule for downlink "
"assignment at uplink %s, but there is no downlink "
@@ -574,6 +573,7 @@
return NULL;
}
+ new_dl_tbf->was_releasing = was_releasing;
msg = msgb_alloc(23, "rlcmac_dl_ass");
if (!msg)
return NULL;