From c843351892d464b6ac4da1304f69cb705d630c7d Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Mon, 25 Jul 2011 20:44:22 +0000 Subject: [PATCH] handle malloc error for rfcomm_channel incoming --- src/rfcomm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rfcomm.c b/src/rfcomm.c index 4fef6891f..93e076673 100644 --- a/src/rfcomm.c +++ b/src/rfcomm.c @@ -1009,6 +1009,10 @@ static void rfcomm_channel_state_machine_2(rfcomm_multiplexer_t * multiplexer, u case CH_EVT_RCVD_RPN_CMD: // setup incoming channel channel = rfcomm_channel_create(multiplexer, service, dlci >> 1); + if (!channel){ + // discard request by sending disconnected mode + multiplexer->send_dm_for_dlci = dlci; + } break; default: break;