[Ffmpeg-cvslog] r5785 - trunk/libavformat/http.c

gpoirier subversion
Wed Jul 19 10:06:24 CEST 2006


Author: gpoirier
Date: Wed Jul 19 10:06:24 2006
New Revision: 5785

Modified:
   trunk/libavformat/http.c

Log:
Fix memleak, patch by  I. Po % yyymmmm # gmail O com %
Original thread:
Date: Jul 18, 2006 3:49 PM
Subject: Re: [Ffmpeg-devel] [PATCH] http.c: http_connect() memleak


Modified: trunk/libavformat/http.c
==============================================================================
--- trunk/libavformat/http.c	(original)
+++ trunk/libavformat/http.c	Wed Jul 19 10:06:24 2006
@@ -181,11 +181,13 @@
     HTTPContext *s = h->priv_data;
     int post, err, ch;
     char line[1024], *q;
+    char *auth_b64;
 
 
     /* send http header */
     post = h->flags & URL_WRONLY;
 
+    auth_b64 = b64_encode(auth);
     snprintf(s->buffer, sizeof(s->buffer),
              "%s %s HTTP/1.0\r\n"
              "User-Agent: %s\r\n"
@@ -197,8 +199,9 @@
              path,
              LIBAVFORMAT_IDENT,
              hoststr,
-             b64_encode(auth));
+             auth_b64);
 
+    av_freep(&auth_b64);
     if (http_write(h, s->buffer, strlen(s->buffer)) < 0)
         return AVERROR_IO;
 




More information about the ffmpeg-cvslog mailing list