bsc: Fix possible crash when the lchan->conn alloc failed

Another null pointer dereference found by clang.
This commit is contained in:
Holger Hans Peter Freyther 2011-01-16 18:15:26 +01:00
parent 5f83382c1a
commit 366a559fed
1 changed files with 5 additions and 2 deletions

View File

@ -478,9 +478,12 @@ int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id)
} else {
rc = BSC_API_CONN_POL_REJECT;
lchan->conn = subscr_con_allocate(msg->lchan);
if (!lchan->conn) {
lchan_release(lchan, 0, 0);
return -1;
}
if (lchan->conn)
rc = api->compl_l3(lchan->conn, msg, 0);
rc = api->compl_l3(lchan->conn, msg, 0);
if (rc != BSC_API_CONN_POL_ACCEPT) {
lchan->conn->lchan = NULL;