aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/librtmp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-06 19:12:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-06 19:12:52 +0200
commit1c8c4b8a89b91c60b6c1687241e9cbf64e8949a5 (patch)
tree83f5dc68a3945058c185e0ac1916181ea26f03d9 /libavformat/librtmp.c
parente592bf3d2ff7280188d32ce1699b074917600e6d (diff)
parent865461099e062de5a3a109c2a5be98004c11d8bd (diff)
downloadffmpeg-1c8c4b8a89b91c60b6c1687241e9cbf64e8949a5.tar.gz
Merge commit '865461099e062de5a3a109c2a5be98004c11d8bd'
* commit '865461099e062de5a3a109c2a5be98004c11d8bd': librtmp: Don't free the temp url at the end of rtmp_open Conflicts: libavformat/librtmp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/librtmp.c')
-rw-r--r--libavformat/librtmp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 5172c5148a..c57699cc9e 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -47,6 +47,7 @@ typedef struct LibRTMPContext {
char *pageurl;
char *client_buffer_time;
int live;
+ char *temp_filename;
} LibRTMPContext;
static void rtmp_log(int level, const char *fmt, va_list args)
@@ -71,6 +72,7 @@ static int rtmp_close(URLContext *s)
RTMP *r = &ctx->rtmp;
RTMP_Close(r);
+ av_freep(&ctx->temp_filename);
return 0;
}
@@ -149,7 +151,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
len += strlen(ctx->swfurl);
}
- if (!(filename = av_malloc(len)))
+ if (!(ctx->temp_filename = filename = av_malloc(len)))
return AVERROR(ENOMEM);
av_strlcpy(filename, s->filename, len);
@@ -229,10 +231,9 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
}
s->is_streamed = 1;
- rc = 0;
+ return 0;
fail:
- if (filename != s->filename)
- av_freep(&filename);
+ av_freep(&ctx->temp_filename);
if (rc)
RTMP_Close(r);