diff options
author | I. Po <yyymmmm@gmail.com> | 2006-07-19 08:06:24 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2006-07-19 08:06:24 +0000 |
commit | cfc4bd4695efcf6d9b246fad12b391161ff35c9c (patch) | |
tree | 06e7eafe7ed5680bb996565055a252cba4171e0d /libavformat | |
parent | cea8f6f323d661b5412d9cc3d1be6d3026f1b213 (diff) | |
download | ffmpeg-cfc4bd4695efcf6d9b246fad12b391161ff35c9c.tar.gz |
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
Originally committed as revision 5785 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/http.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c index 48099c35ee..0e41d06631 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -181,11 +181,13 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr, 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 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr, 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; |