mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
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/branches/1.4@89545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -168,6 +168,7 @@ static int adsi_careful_send(struct ast_channel *chan, unsigned char *buf, int l
|
|||||||
/* Read a voice frame */
|
/* Read a voice frame */
|
||||||
if (inf->subclass != AST_FORMAT_ULAW) {
|
if (inf->subclass != AST_FORMAT_ULAW) {
|
||||||
ast_log(LOG_WARNING, "Channel not in ulaw?\n");
|
ast_log(LOG_WARNING, "Channel not in ulaw?\n");
|
||||||
|
ast_frfree(inf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* Send no more than they sent us */
|
/* 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;
|
outf.samples = amt;
|
||||||
if (ast_write(chan, &outf)) {
|
if (ast_write(chan, &outf)) {
|
||||||
ast_log(LOG_WARNING, "Failed to carefully write frame\n");
|
ast_log(LOG_WARNING, "Failed to carefully write frame\n");
|
||||||
|
ast_frfree(inf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* Update pointers and lengths */
|
/* Update pointers and lengths */
|
||||||
@@ -256,6 +258,7 @@ static int __adsi_transmit_messages(struct ast_channel *chan, unsigned char **ms
|
|||||||
if (!chan->adsicpe)
|
if (!chan->adsicpe)
|
||||||
chan->adsicpe = AST_ADSI_UNAVAILABLE;
|
chan->adsicpe = AST_ADSI_UNAVAILABLE;
|
||||||
errno = ENOSYS;
|
errno = ENOSYS;
|
||||||
|
ast_frfree(f);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user