mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Try to eliminate memory leak on stream termination. It doesn't crash, but I'm
not sure if it fixes the problem. Originally committed as revision 1620 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
cb275dd9eb
commit
87638494ca
11
ffserver.c
11
ffserver.c
@ -743,6 +743,17 @@ static void close_connection(HTTPContext *c)
|
||||
}
|
||||
}
|
||||
|
||||
if (!c->last_packet_sent) {
|
||||
ctx = &c->fmt_ctx;
|
||||
if (ctx->oformat) {
|
||||
/* prepare header */
|
||||
if (url_open_dyn_buf(&ctx->pb) >= 0) {
|
||||
av_write_trailer(ctx);
|
||||
(void) url_close_dyn_buf(&ctx->pb, &c->pb_buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (c->stream)
|
||||
current_bandwidth -= c->stream->bandwidth;
|
||||
av_freep(&c->pb_buffer);
|
||||
|
Loading…
Reference in New Issue
Block a user