[FFmpeg-cvslog] r23290 - trunk/ffserver.c

mstorsjo subversion
Mon May 24 21:05:23 CEST 2010


Author: mstorsjo
Date: Mon May 24 21:05:22 2010
New Revision: 23290

Log:
ffserver: Plug some memory leaks

Patch by Howard Chu, hyc at highlandsun dot com

Modified:
   trunk/ffserver.c

Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c	Mon May 24 19:49:26 2010	(r23289)
+++ trunk/ffserver.c	Mon May 24 21:05:22 2010	(r23290)
@@ -847,6 +847,8 @@ static void close_connection(HTTPContext
         ctx = c->rtp_ctx[i];
         if (ctx) {
             av_write_trailer(ctx);
+            av_metadata_free(&ctx->metadata);
+            av_free(ctx->streams[0]);
             av_free(ctx);
         }
         h = c->rtp_handles[i];
@@ -2280,6 +2282,7 @@ static int http_prepare_data(HTTPContext
             http_log("Error writing output header\n");
             return -1;
         }
+        av_metadata_free(&c->fmt_ctx.metadata);
 
         len = url_close_dyn_buf(c->fmt_ctx.pb, &c->pb_buffer);
         c->buffer_ptr = c->pb_buffer;
@@ -2954,6 +2957,7 @@ static int prepare_sdp_description(FFStr
     }
     *pbuffer = av_mallocz(2048);
     avf_sdp_create(&avc, 1, *pbuffer, 2048);
+    av_metadata_free(&avc->metadata);
     av_free(avc);
 
     return strlen(*pbuffer);
@@ -3010,6 +3014,7 @@ static void rtsp_cmd_describe(HTTPContex
     url_fprintf(c->pb, "Content-Length: %d\r\n", content_length);
     url_fprintf(c->pb, "\r\n");
     put_buffer(c->pb, content, content_length);
+    av_free(content);
 }
 
 static HTTPContext *find_rtp_session(const char *session_id)



More information about the ffmpeg-cvslog mailing list