Committed by
winlin
fix #826, fix memory leak in streamCasterFlv (#836)
正在显示
1 个修改的文件
包含
5 行增加
和
0 行删除
| @@ -86,6 +86,11 @@ void SrsAppCasterFlv::remove(SrsConnection* c) | @@ -86,6 +86,11 @@ void SrsAppCasterFlv::remove(SrsConnection* c) | ||
| 86 | if ((it = std::find(conns.begin(), conns.end(), c)) != conns.end()) { | 86 | if ((it = std::find(conns.begin(), conns.end(), c)) != conns.end()) { |
| 87 | conns.erase(it); | 87 | conns.erase(it); |
| 88 | } | 88 | } |
| 89 | + | ||
| 90 | + // fixbug: SrsHttpConn for CasterFlv is not freed, which could cause memory leak | ||
| 91 | + // so, free conn which is not managed by SrsServer->conns; | ||
| 92 | + // @see: https://github.com/ossrs/srs/issues/826 | ||
| 93 | + srs_freep(c); | ||
| 89 | } | 94 | } |
| 90 | 95 | ||
| 91 | int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) | 96 | int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) |
-
请 注册 或 登录 后发表评论