[MPlayer-cvslog] r21806 - in trunk/stream/realrtsp: real.c sdpplin.c
rtogni
subversion at mplayerhq.hu
Mon Jan 1 23:32:09 CET 2007
Author: rtogni
Date: Mon Jan 1 23:32:09 2007
New Revision: 21806
Modified:
trunk/stream/realrtsp/real.c
trunk/stream/realrtsp/sdpplin.c
Log:
Memleak fix (implement sdpplin_free() and use it)
Modified: trunk/stream/realrtsp/real.c
==============================================================================
--- trunk/stream/realrtsp/real.c (original)
+++ trunk/stream/realrtsp/real.c Mon Jan 1 23:32:09 2007
@@ -337,6 +337,7 @@
rmff_fix_header(header);
buf = xbuffer_free(buf);
+ sdpplin_free(desc);
return header;
}
Modified: trunk/stream/realrtsp/sdpplin.c
==============================================================================
--- trunk/stream/realrtsp/sdpplin.c (original)
+++ trunk/stream/realrtsp/sdpplin.c Mon Jan 1 23:32:09 2007
@@ -360,7 +360,33 @@
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);
}
More information about the MPlayer-cvslog
mailing list