aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-24 16:59:59 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-24 16:59:59 +0000
commitf78841fc40fd954f2ce3a6fdcbe75ba2aa227efe (patch)
tree6dc4caf9ff4498c26958bb0d62b2a9cb2050925c
parente8b92d93519b84b9287ba0397f9923b77ff4d061 (diff)
Free some frames that would otherwise leak on error.
Reported by: Laureano Patch by: Laureano,tilghman (Closes issue #11351) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89545 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_adsi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_adsi.c b/res/res_adsi.c
index 950e4f865..38648a8d4 100644
--- a/res/res_adsi.c
+++ b/res/res_adsi.c
@@ -168,6 +168,7 @@ static int adsi_careful_send(struct ast_channel *chan, unsigned char *buf, int l
/* Read a voice frame */
if (inf->subclass != AST_FORMAT_ULAW) {
ast_log(LOG_WARNING, "Channel not in ulaw?\n");
+ ast_frfree(inf);
return -1;
}
/* Send no more than they sent us */
@@ -182,6 +183,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 */
@@ -256,6 +258,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;
}
}