aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-26 18:32:00 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-26 18:32:00 +0100
commitf5c97476de68ac7ce2fba48be1e7502c1c794606 (patch)
tree8584ae4777d3dd2a84875f45ff4e6015384167b2 /src/tbf.cpp
parent49f26bf6e8285cd99f7e5d71d9f902f10b9212a1 (diff)
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
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r--src/tbf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 2afe2576..680a096a 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -565,7 +565,6 @@ struct msgb *gprs_rlcmac_tbf::create_dl_ass(uint32_t fn)
}
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 @@ struct msgb *gprs_rlcmac_tbf::create_dl_ass(uint32_t fn)
return NULL;
}
+ new_dl_tbf->was_releasing = was_releasing;
msg = msgb_alloc(23, "rlcmac_dl_ass");
if (!msg)
return NULL;