Commit f02221d6 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'f6b3dce9' into release/2.2

* commit 'f6b3dce9':
  librtmp: Don't free the temp url at the end of rtmp_open

Conflicts:
	libavformat/librtmp.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 92c49737 f6b3dce9
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment