diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp index 6ac0c2b5f..d6cdbe42c 100644 --- a/trunk/src/app/srs_app_hls.cpp +++ b/trunk/src/app/srs_app_hls.cpp @@ -1117,6 +1117,7 @@ int SrsHlsCache::reap_segment(string log_desc, SrsHlsMuxer* muxer, int64_t segme SrsHls::SrsHls() { + _req = NULL; source = NULL; handler = NULL; @@ -1137,6 +1138,7 @@ SrsHls::SrsHls() SrsHls::~SrsHls() { + srs_freep(_req); srs_freep(codec); srs_freep(sample); srs_freep(jitter); @@ -1205,7 +1207,8 @@ int SrsHls::on_publish(SrsRequest* req) { int ret = ERROR_SUCCESS; - _req = req; + srs_freep(_req); + _req = req->copy(); // update the hls time, for hls_dispose. last_update_time = srs_get_system_time_ms();