@@ -1240,7 +1240,7 @@ start:
av_strlcpy(rt->session_id, reply->session_id, sizeof(rt->session_id));
content_length = reply->content_length;
- if (content_length > 0) {
+ if (content_ptr && content_length > 0) {
/* leave some room for a trailing '\0' (useful for simple parsing) */
content = av_malloc(content_length + 1);
if (!content)
@@ -1250,11 +1250,8 @@ start:
return AVERROR_EOF;
}
content[content_length] = '\0';
- }
- if (content_ptr)
*content_ptr = content;
- else
- av_freep(&content);
+ }
if (request) {
char buf[MAX_URL_SIZE];