aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-06 16:29:16 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-06 16:29:16 +0000
commit523fa9cb0718fff4be07d43fa5759ac8381c3330 (patch)
tree4f2b4f7e5dd2dc056acd682204b466b73f64f3dc /channels/chan_zap.c
parent3f48783c29e2b082690b7c28e083e7fba9d16562 (diff)
Merged revisions 88994 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r88994 | file | 2007-11-06 12:24:56 -0400 (Tue, 06 Nov 2007) | 6 lines Fix improbable but possible memory leaks in chan_zap. (closes issue #11166) Reported by: eliel Patches: chan_zap.c.patch uploaded by eliel (license 64) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88995 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 556cdc59c..bf416c7a8 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -1073,7 +1073,13 @@ static int zt_open(char *fn)
}
}
bs = READ_SIZE;
- if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs) == -1) return -1;
+ if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs) == -1) {
+ ast_log(LOG_WARNING, "Unable to set blocksize '%d': %s\n", bs, strerror(errno));
+ x = errno;
+ close(fd);
+ errno = x;
+ return -1;
+ }
return fd;
}
@@ -13216,8 +13222,10 @@ static int zt_sendtext(struct ast_channel *c, const char *text)
continue;
}
/* if got exception */
- if (fds[0].revents & POLLPRI)
+ if (fds[0].revents & POLLPRI) {
+ ast_free(mybuf);
return -1;
+ }
if (!(fds[0].revents & POLLOUT)) {
ast_debug(1, "write fd not ready on channel %d\n", p->channel);
continue;