changeset 1181:c2f51d81c72e libavformat

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
author gpoirier
date Wed, 19 Jul 2006 08:06:24 +0000
parents 92fdb5e2a2d7
children 3fd51d88c897
files http.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/http.c	Tue Jul 18 18:51:35 2006 +0000
+++ b/http.c	Wed Jul 19 08:06:24 2006 +0000
@@ -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;