summaryrefslogtreecommitdiff
path: root/ffserver.c
diff options
context:
space:
mode:
authorPhilip Gladstone <philipjsg@users.sourceforge.net>2003-03-04 03:12:32 +0000
committerPhilip Gladstone <philipjsg@users.sourceforge.net>2003-03-04 03:12:32 +0000
commit87638494cac0e58178a445b2c6436264b3af31e9 (patch)
tree4ab8767b6715efdc3103fc77cbb038dcbd21f763 /ffserver.c
parentcb275dd9ebb5566ce38ccc66755ab597fd4cdad7 (diff)
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
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ffserver.c b/ffserver.c
index 91ca672e59..76c9bce059 100644
--- a/ffserver.c
+++ b/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);