git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@33544
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
i += wf.datalen / 8;
if (i > duration) {
+ ast_frfree(f);
break;
}
if (ast_write(chan, &wf)){
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Failed to write frame on %s\n", chan->name);
ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name);
res = -1;
+ ast_frfree(f);
break;
}
}
myf.f.data = myf.frdata;
if (ast_write(chan, &myf.f) < 0) {
res = -1;
+ ast_frfree(f);
break;
}
if (res < needed) { /* last frame */
ast_log(LOG_DEBUG, "Last frame\n");
res=0;
+ ast_frfree(f);
break;
}
} else {
if (errno != EAGAIN) {
ast_log(LOG_WARNING, "Write failed to pipe: %s\n", strerror(errno));
res = -1;
+ ast_frfree(f);
break;
}
}