diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c index 84a3cdd18f..3ad4fa9a7f 100644 --- a/stream/realrtsp/real.c +++ b/stream/realrtsp/real.c @@ -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; } diff --git a/stream/realrtsp/sdpplin.c b/stream/realrtsp/sdpplin.c index 359fe10678..862fe0dbfb 100644 --- a/stream/realrtsp/sdpplin.c +++ b/stream/realrtsp/sdpplin.c @@ -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); }