Commit 392c7b8a authored by Brian Kurle's avatar Brian Kurle Committed by Jean-Paul Saman

relative_URI memory leak cleanup

If the the link is relative, psz_uri is dynamically allocated a string of the
absolute URI (which is also returned by the function).   However, if it isn't,
NULL is returned and nothing is allocated.   segment_New performs a strdup, so
the pointer is not saved.   Thus, check if the allocation occurred and clean up
if needed.
Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jean-paul.saman@m2x.nl>
parent 17ce236d
......@@ -388,6 +388,8 @@ static void parse_SegmentInformation(stream_t *s, hls_stream_t *hls, char *p_rea
duration, hls->duration);
}
vlc_mutex_unlock(&hls->lock);
free(psz_uri);
}
static void parse_TargetDuration(stream_t *s, hls_stream_t *hls, char *p_read)
......@@ -451,6 +453,8 @@ static void parse_StreamInformation(stream_t *s, char *p_read, char *uri)
hls_stream_t *hls = hls_New(p_sys->hls_stream, id, bw, psz_uri ? psz_uri : uri);
if (hls == NULL)
p_sys->b_error = true;
free(psz_uri);
}
static void parse_MediaSequence(stream_t *s, hls_stream_t *hls, char *p_read)
......
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