haofz
Committed by winlin

fix #826, fix memory leak in streamCasterFlv (#836)

@@ -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)