mirror of
https://github.com/mpv-player/mpv
synced 2025-02-20 06:46:55 +00:00
Memleak fix (implement sdpplin_free() and use it)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21806 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
959bb649e9
commit
ac5d629479
@ -337,6 +337,7 @@ static rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t b
|
||||
|
||||
rmff_fix_header(header);
|
||||
buf = xbuffer_free(buf);
|
||||
sdpplin_free(desc);
|
||||
|
||||
return header;
|
||||
}
|
||||
|
@ -360,7 +360,33 @@ sdpplin_t *sdpplin_parse(char *data) {
|
||||
|
||||
void sdpplin_free(sdpplin_t *description) {
|
||||
|
||||
/* TODO: free strings */
|
||||
int i;
|
||||
|
||||
if (!description)
|
||||
return;
|
||||
|
||||
for (i = 0; i < description->stream_count; i++) {
|
||||
if (description->stream[i]) {
|
||||
if (description->stream[i]->stream_name)
|
||||
free(description->stream[i]->stream_name);
|
||||
if (description->stream[i]->mime_type)
|
||||
free(description->stream[i]->mime_type);
|
||||
if (description->stream[i]->mlti_data)
|
||||
free(description->stream[i]->mlti_data);
|
||||
if (description->stream[i]->asm_rule_book)
|
||||
free(description->stream[i]->asm_rule_book);
|
||||
}
|
||||
}
|
||||
|
||||
if (description->title)
|
||||
free(description->title);
|
||||
if (description->author)
|
||||
free(description->author);
|
||||
if (description->copyright)
|
||||
free(description->copyright);
|
||||
if (description->abstract)
|
||||
free(description->abstract);
|
||||
|
||||
free(description);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user