lapd: Fixed possible double free buf in lapd_core.c

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Andreas Eversberg 2011-11-01 09:40:21 +01:00 committed by Harald Welte
parent f948dbc442
commit 5ad4ac800c
1 changed files with 3 additions and 2 deletions

View File

@ -1920,10 +1920,11 @@ static int lapd_res_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
if (dl->send_buffer)
msgb_free(dl->send_buffer);
dl->send_out = 0;
if (msg && msg->len) {
if (msg && msg->len)
/* Write data into the send buffer, to be sent first */
dl->send_buffer = msg;
}
else
dl->send_buffer = NULL;
/* Discard partly received L3 message */
if (dl->rcv_buffer) {