diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2020-09-21 18:41:21 +0200 |
---|---|---|
committer | Alexander Couzens <lynxis@fe80.eu> | 2020-09-21 18:41:58 +0200 |
commit | 9a701d7e70a16ec138736d2765725e2a4f747823 (patch) | |
tree | 3949a4fe765b50e1e82ba8cb1e7d405e4b8c9038 /src/osmo-bsc/abis_nm.c | |
parent | 1a7e3ccef16713ecb5441ad13977744576467e23 (diff) |
abis_nm: abis_nm_perform_test: fix a potential null deref
gcc 10.2.0 warns msgb can be a deref because nm_msgb_alloc() can fail with null.
Change-Id: I4b0e4cd15046272e026cd74c14cbf2972ef6a070
Diffstat (limited to 'src/osmo-bsc/abis_nm.c')
-rw-r--r-- | src/osmo-bsc/abis_nm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index ec5238088..469113750 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -2193,8 +2193,11 @@ int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class, DEBUGP(DNM, "PERFORM TEST %s\n", abis_nm_test_name(test_nr)); - if (!msg) + if (!msg) { msg = nm_msgb_alloc(); + if (!msg) + return -ENOMEM; + } msgb_tv_push(msg, NM_ATT_AUTON_REPORT, auton_report); msgb_tv_push(msg, NM_ATT_TEST_NO, test_nr); |