aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/misc
diff options
context:
space:
mode:
authorMichael Santos <[email protected]>2010-10-28 20:45:35 -0400
committerBjörn Gustavsson <[email protected]>2010-10-29 15:32:19 +0200
commit9dae2c94560e0b8e5a69f8d2b22f4abc858c3bd7 (patch)
treec90d1400b3d24f5383fe7f4ff799d753976453d0 /lib/erl_interface/src/misc
parent3a1c6808c41243552915f841ec885d6ecf97ebd6 (diff)
downloadotp-9dae2c94560e0b8e5a69f8d2b22f4abc858c3bd7.tar.gz
otp-9dae2c94560e0b8e5a69f8d2b22f4abc858c3bd7.tar.bz2
otp-9dae2c94560e0b8e5a69f8d2b22f4abc858c3bd7.zip
ei: check memory was allocated
Diffstat (limited to 'lib/erl_interface/src/misc')
-rw-r--r--lib/erl_interface/src/misc/ei_portio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/erl_interface/src/misc/ei_portio.c b/lib/erl_interface/src/misc/ei_portio.c
index c4e397f1e0..a3f6f63fff 100644
--- a/lib/erl_interface/src/misc/ei_portio.c
+++ b/lib/erl_interface/src/misc/ei_portio.c
@@ -166,6 +166,9 @@ int ei_writev_fill_t(int fd, const struct iovec *iov, int iovcnt, unsigned
if (done < sum) {
if (iov_base == NULL) {
iov_base = malloc(sizeof(struct iovec) * iovcnt);
+ if (iov_base == NULL) {
+ return -1;
+ }
memcpy(iov_base, iov, sizeof(struct iovec) * iovcnt);
current_iov = iov_base;
}