mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Set req->data to NULL after free'ing to ensure that it never gets accidentally
double free'd. (reported by dhubbard directly to me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3100,6 +3100,7 @@ static int send_response(struct sip_pvt *p, struct sip_request *req, enum xmitty
|
||||
__sip_reliable_xmit(p, seqno, 1, req->data, req->len, (reliable == XMIT_CRITICAL), req->method) :
|
||||
__sip_xmit(p, req->data, req->len);
|
||||
ast_free(req->data);
|
||||
req->data = NULL;
|
||||
if (res > 0)
|
||||
return 0;
|
||||
return res;
|
||||
@@ -3133,8 +3134,10 @@ static int send_request(struct sip_pvt *p, struct sip_request *req, enum xmittyp
|
||||
res = (reliable) ?
|
||||
__sip_reliable_xmit(p, seqno, 0, req->data, req->len, (reliable == XMIT_CRITICAL), req->method) :
|
||||
__sip_xmit(p, req->data, req->len);
|
||||
if (req->data)
|
||||
if (req->data) {
|
||||
ast_free(req->data);
|
||||
req->data = NULL;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -18102,6 +18105,7 @@ static int handle_request_do(struct sip_request *req, struct sockaddr_in *sin)
|
||||
|
||||
if (req->headers < 2) { /* Must have at least two headers */
|
||||
ast_free(req->data);
|
||||
req->data = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user