summaryrefslogtreecommitdiffstats
path: root/stream/realrtsp
diff options
context:
space:
mode:
authorrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-01 22:32:09 +0000
committerrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-01 22:32:09 +0000
commitac5d629479c4594c455d4c9d6e9610d725386feb (patch)
tree0bf9269d77f15b9bfc7bca8f9bb7881dd92ae733 /stream/realrtsp
parent959bb649e9e851af8fd96461a239a734bb25230c (diff)
downloadmpv-ac5d629479c4594c455d4c9d6e9610d725386feb.tar.bz2
mpv-ac5d629479c4594c455d4c9d6e9610d725386feb.tar.xz
Memleak fix (implement sdpplin_free() and use it)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21806 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/realrtsp')
-rw-r--r--stream/realrtsp/real.c1
-rw-r--r--stream/realrtsp/sdpplin.c28
2 files changed, 28 insertions, 1 deletions
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);
}