Merged revisions 89545 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Sat, 24 Nov 2007 17:07:12 +0000 (17:07 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sat, 24 Nov 2007 17:07:12 +0000 (17:07 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89545 | tilghman | 2007-11-24 10:59:59 -0600 (Sat, 24 Nov 2007) | 5 lines

Free some frames that would otherwise leak on error.
Reported by: Laureano
Patch by: Laureano,tilghman
(Closes issue #11351)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89546 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_adsi.c

index 664157c..149381a 100644 (file)
@@ -179,6 +179,7 @@ static int adsi_careful_send(struct ast_channel *chan, unsigned char *buf, int l
                outf.samples = amt;
                if (ast_write(chan, &outf)) {
                        ast_log(LOG_WARNING, "Failed to carefully write frame\n");
+                       ast_frfree(inf);
                        return -1;
                }
                /* Update pointers and lengths */
@@ -242,6 +243,7 @@ static int __adsi_transmit_messages(struct ast_channel *chan, unsigned char **ms
                                                if (!chan->adsicpe)
                                                        chan->adsicpe = AST_ADSI_UNAVAILABLE;
                                                errno = ENOSYS;
+                                               ast_frfree(f);
                                                return -1;
                                        }
                                }