FS-5395: --resolve Resolve another mod_rtmp crash where oh specific hangup scenarios there would be a free of variable that wasn't ever malloced

This commit is contained in:
William King 2013-05-08 16:31:27 -07:00
parent 2e19cbcc61
commit 924e24a0de
2 changed files with 5 additions and 2 deletions

View File

@ -767,6 +767,7 @@ switch_status_t rtmp_session_request(rtmp_profile_t *profile, rtmp_session_t **n
(*newsession)->in_chunksize = (*newsession)->out_chunksize = RTMP_DEFAULT_CHUNKSIZE;
(*newsession)->recv_ack_window = RTMP_DEFAULT_ACK_WINDOW;
(*newsession)->next_streamid = 1;
(*newsession)->io_private = NULL;
switch_uuid_get(&uuid);
switch_uuid_format((*newsession)->uuid, &uuid);

View File

@ -183,8 +183,10 @@ static switch_status_t rtmp_tcp_close(rtmp_session_t *rsession)
switch_buffer_destroy(&(io_pvt->sendq));
}
free(rsession->io_private);
rsession->io_private = NULL;
if ( rsession->io_private ) {
free(rsession->io_private);
rsession->io_private = NULL;
}
return SWITCH_STATUS_SUCCESS;
}