aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a78489446..31a3a6604 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -15710,10 +15710,12 @@ static void *sip_park_thread(void *stuff)
transferee = d->chan1;
transferer = d->chan2;
copy_request(&req, &d->req);
- ast_free(d);
if (!transferee || !transferer) {
ast_log(LOG_ERROR, "Missing channels for parking! Transferer %s Transferee %s\n", transferer ? "<available>" : "<missing>", transferee ? "<available>" : "<missing>" );
+ if (d->req.data)
+ ast_free(d->req.data);
+ free(d);
return NULL;
}
ast_debug(4, "SIP Park: Transferer channel %s, Transferee %s\n", transferer->name, transferee->name);
@@ -15723,6 +15725,9 @@ static void *sip_park_thread(void *stuff)
ast_log(LOG_WARNING, "Masquerade failed.\n");
transmit_response(transferer->tech_pvt, "503 Internal error", &req);
ast_channel_unlock(transferee);
+ if (d->req.data)
+ ast_free(d->req.data);
+ free(d);
return NULL;
}
ast_channel_unlock(transferee);
@@ -15756,6 +15761,9 @@ static void *sip_park_thread(void *stuff)
ast_debug(1, "SIP Call parked failed \n");
/* Do not hangup call */
}
+ if (d->req.data)
+ ast_free(d->req.data);
+ free(d);
return NULL;
}