[rtmpdump] branch master updated. b627335 Plug potential memleak

gitolite gil at avcodec.org
Sat Jul 23 03:07:27 CEST 2011


The branch, master has been updated
       via  b627335dc37fd5265ac6d23a441ee2d89ab503c8 (commit)
       via  530d02fccf24f98e2e318418b2fa3e3420056fda (commit)
      from  159a06ebe6d82ef20f2c77c497d55af00d2e0b78 (commit)


- Log -----------------------------------------------------------------
commit b627335dc37fd5265ac6d23a441ee2d89ab503c8
Author:     Howard Chu <hyc at highlandsun.com>
AuthorDate: Fri Jul 22 18:06:27 2011 -0700
Commit:     Howard Chu <hyc at highlandsun.com>
CommitDate: Fri Jul 22 18:06:27 2011 -0700

    Plug potential memleak
    
    Reported by Reijo Tomperi <aggro80 at users.sourceforge.net>

diff --git a/rtmpdump.c b/rtmpdump.c
index 89c053a..e506fa9 100644
--- a/rtmpdump.c
+++ b/rtmpdump.c
@@ -444,7 +444,7 @@ Download(RTMP * rtmp,		// connected RTMP object
 {
   int32_t now, lastUpdate;
   int bufferSize = 64 * 1024;
-  char *buffer = (char *) malloc(bufferSize);
+  char *buffer;
   int nRead = 0;
   off_t size = ftello(file);
   unsigned long lastPercent = 0;
@@ -505,6 +505,8 @@ Download(RTMP * rtmp,		// connected RTMP object
   rtmp->m_read.nMetaHeaderSize = nMetaHeaderSize;
   rtmp->m_read.nInitialFrameSize = nInitialFrameSize;
 
+  buffer = (char *) malloc(bufferSize);
+
   now = RTMP_GetTime();
   lastUpdate = now - 1000;
   do

commit 530d02fccf24f98e2e318418b2fa3e3420056fda
Author:     Howard Chu <hyc at highlandsun.com>
AuthorDate: Fri Jul 22 18:04:05 2011 -0700
Commit:     Howard Chu <hyc at highlandsun.com>
CommitDate: Fri Jul 22 18:04:05 2011 -0700

    Fix MDH_free() for PolarSSL
    
    Reported by Reijo Tomperi <aggro80 at users.sourceforge.net>

diff --git a/librtmp/dh.h b/librtmp/dh.h
index 8e285a6..efef0fd 100644
--- a/librtmp/dh.h
+++ b/librtmp/dh.h
@@ -53,7 +53,7 @@ typedef struct MDH {
 } MDH;
 
 #define MDH_new()	calloc(1,sizeof(MDH))
-#define MDH_free(vp)	{MDH *dh = vp; dhm_free(&dh->ctx); MP_free(dh->p); MP_free(dh->g); MP_free(dh->pub_key); MP_free(dh->priv_key); free(dh);}
+#define MDH_free(vp)	{MDH *_dh = vp; dhm_free(&_dh->ctx); MP_free(_dh->p); MP_free(_dh->g); MP_free(_dh->pub_key); MP_free(_dh->priv_key); free(_dh);}
 
 static int MDH_generate_key(MDH *dh)
 {

-----------------------------------------------------------------------

Summary of changes:
 librtmp/dh.h |    2 +-
 rtmpdump.c   |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)


hooks/post-receive
-- 



More information about the rtmpdump mailing list