ffserver: fix streams and priv_data memleaks when closing a connection.
authorClément Bœsch <clement.boesch@smartjog.com>
Tue, 13 Nov 2012 15:32:35 +0000 (17:32 +0200)
committerClément Bœsch <ubitux@gmail.com>
Thu, 15 Nov 2012 10:52:44 +0000 (11:52 +0100)
ffserver.c

index 18271ce..1f27237 100644 (file)
@@ -929,6 +929,8 @@ static void close_connection(HTTPContext *c)
 
     for(i=0; i<ctx->nb_streams; i++)
         av_free(ctx->streams[i]);
 
     for(i=0; i<ctx->nb_streams; i++)
         av_free(ctx->streams[i]);
+    av_freep(&ctx->streams);
+    av_freep(&ctx->priv_data);
 
     if (c->stream && !c->post && c->stream->stream_type == STREAM_TYPE_LIVE)
         current_bandwidth -= c->stream->bandwidth;
 
     if (c->stream && !c->post && c->stream->stream_type == STREAM_TYPE_LIVE)
         current_bandwidth -= c->stream->bandwidth;