[FFmpeg-soc] [soc]: r5744 - mms/mmst.c

spyfeng subversion at mplayerhq.hu
Thu Apr 8 18:02:41 CEST 2010


Author: spyfeng
Date: Thu Apr  8 18:02:41 2010
New Revision: 5744

Log:
fix memory leak for av_realloc() failure.

Modified:
   mms/mmst.c

Modified: mms/mmst.c
==============================================================================
--- mms/mmst.c	Thu Apr  8 15:03:53 2010	(r5743)
+++ mms/mmst.c	Thu Apr  8 18:02:41 2010	(r5744)
@@ -326,8 +326,10 @@ static MMSSCPacketType get_tcp_server_re
                             mms->asf_header = av_realloc(mms->asf_header,
                                               mms->asf_header_size
                                               + mms->pkt_buf_len);
-                            if (!mms->asf_header)
+                            if (!mms->asf_header) {
+                                av_freep(&mms->asf_header);
                                 return AVERROR(ENOMEM);
+                            }
                             memcpy(mms->asf_header + mms->asf_header_size,
                                                  mms->pkt_read_ptr,
                                                  mms->pkt_buf_len);


More information about the FFmpeg-soc mailing list