diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-09 10:24:32 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-09 10:24:32 +0000 |
commit | 2b2179f959da07f47a21715f29380ccb1698880c (patch) | |
tree | ceb971b0ab0bae60a7450a8cc7af0c5176d7df3f | |
parent | 006818935c2d1d5276c616c338258986b69c216c (diff) |
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)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@141996 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_oss.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/channels/chan_oss.c b/channels/chan_oss.c index 9d1c4569c..12800d975 100644 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -1452,18 +1452,22 @@ static int load_module(void) 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; } |