Fixed ticket #291: Free memory read in PUBLISH session

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1292 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2007-05-23 14:12:35 +00:00
parent c9f6ea7052
commit da1e0635b0
1 changed files with 7 additions and 0 deletions

View File

@ -544,11 +544,18 @@ static void tsx_callback(void *token, pjsip_event *event)
/* Call callback. */
if (expiration == 0xFFFF) expiration = -1;
/* Temporarily increment pending_tsx to prevent callback from
* destroying pubc.
*/
++pubc->pending_tsx;
call_callback(pubc, PJ_SUCCESS, tsx->status_code,
(rdata ? &rdata->msg_info.msg->line.status.reason
: pjsip_get_status_text(tsx->status_code)),
rdata, expiration);
--pubc->pending_tsx;
}
/* Delete the record if user destroy pubc during the callback. */