[asterisk-commits] mmichelson: branch 1.6.0 r141996 - in /branches/1.6.0: ./ channels/chan_oss.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Sep 9 05:24:33 CDT 2008
Author: mmichelson
Date: Tue Sep 9 05:24:32 2008
New Revision: 141996
URL: http://svn.digium.com/view/asterisk?view=rev&rev=141996
Log:
Merged revisions 141995 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r141995 | mmichelson | 2008-09-09 05:20:58 -0500 (Tue, 09 Sep 2008) | 8 lines
Fix a memory leak in chan_oss
(closes issue #13311)
Reported by: eliel
Patches:
chan_oss.c.patch uploaded by eliel (license 64)
........
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/channels/chan_oss.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_oss.c?view=diff&rev=141996&r1=141995&r2=141996
==============================================================================
--- branches/1.6.0/channels/chan_oss.c (original)
+++ branches/1.6.0/channels/chan_oss.c Tue Sep 9 05:24:32 2008
@@ -1452,18 +1452,22 @@
static int unload_module(void)
{
- struct chan_oss_pvt *o;
+ struct chan_oss_pvt *o, *next;
ast_channel_unregister(&oss_tech);
ast_cli_unregister_multiple(cli_oss, sizeof(cli_oss) / sizeof(struct ast_cli_entry));
- for (o = oss_default.next; o; o = o->next) {
+ o = oss_default.next;
+ while (o) {
close(o->sounddev);
if (o->owner)
ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
if (o->owner) /* XXX how ??? */
return -1;
- /* XXX what about the memory allocated ? */
+ next = o->next;
+ ast_free(o->name);
+ ast_free(o);
+ o = next;
}
return 0;
}
More information about the asterisk-commits
mailing list