mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-10-31 12:03:50 +00:00 
			
		
		
		
	bsc: Fix possible crash when the lchan->conn alloc failed
Another null pointer dereference found by clang.
This commit is contained in:
		| @@ -478,9 +478,12 @@ int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id) | |||||||
| 	} else { | 	} else { | ||||||
| 		rc = BSC_API_CONN_POL_REJECT; | 		rc = BSC_API_CONN_POL_REJECT; | ||||||
| 		lchan->conn = subscr_con_allocate(msg->lchan); | 		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) { | 		if (rc != BSC_API_CONN_POL_ACCEPT) { | ||||||
| 			lchan->conn->lchan = NULL; | 			lchan->conn->lchan = NULL; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user