aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-30 20:29:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-30 20:32:53 +0200
commitf02221d65143aa9a5719fa83f159daaa1308b6a0 (patch)
treeaa80ba90519d368f637ec168d65a627a605205b6
parent92c49737522112e9cbe60725cd221046b74b7e1f (diff)
parentf6b3dce952d66f87883a50d90d6e98416ee397df (diff)
downloadffmpeg-f02221d65143aa9a5719fa83f159daaa1308b6a0.tar.gz
Merge commit 'f6b3dce952d66f87883a50d90d6e98416ee397df' into release/2.2
* commit 'f6b3dce952d66f87883a50d90d6e98416ee397df': librtmp: Don't free the temp url at the end of rtmp_open Conflicts: libavformat/librtmp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/librtmp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index f0b5929e6a..94c044226e 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -38,6 +38,7 @@ typedef struct LibRTMPContext {
RTMP rtmp;
char *app;
char *playpath;
+ char *temp_filename;
} LibRTMPContext;
static void rtmp_log(int level, const char *fmt, va_list args)
@@ -62,6 +63,7 @@ static int rtmp_close(URLContext *s)
RTMP *r = &ctx->rtmp;
RTMP_Close(r);
+ av_freep(&ctx->temp_filename);
return 0;
}
@@ -101,7 +103,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
if (ctx->app) len += strlen(ctx->app) + sizeof(" app=");
if (ctx->playpath) len += strlen(ctx->playpath) + sizeof(" playpath=");
- if (!(filename = av_malloc(len)))
+ if (!(ctx->temp_filename = filename = av_malloc(len)))
return AVERROR(ENOMEM);
av_strlcpy(filename, s->filename, len);
@@ -130,10 +132,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);