aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/misc/ei_printterm.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2010-11-22 12:19:21 +0100
committerBjörn-Egil Dahlberg <[email protected]>2010-11-22 12:19:26 +0100
commit29b572dbd1546796a0a94066548edfa3da6b4b9d (patch)
tree5adabfdfdf1ff12ef82ffa0322b225d4b8330225 /lib/erl_interface/src/misc/ei_printterm.c
parentf7d51b976aceb0c3e2c48ad1be2df8b6fff6353d (diff)
parent9dae2c94560e0b8e5a69f8d2b22f4abc858c3bd7 (diff)
downloadotp-29b572dbd1546796a0a94066548edfa3da6b4b9d.tar.gz
otp-29b572dbd1546796a0a94066548edfa3da6b4b9d.tar.bz2
otp-29b572dbd1546796a0a94066548edfa3da6b4b9d.zip
Merge branch 'ms/ei-fixes' into dev
* ms/ei-fixes: ei: check memory was allocated ei: error if return value of ei_alloc_big is NULL OTP-8943
Diffstat (limited to 'lib/erl_interface/src/misc/ei_printterm.c')
-rw-r--r--lib/erl_interface/src/misc/ei_printterm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/erl_interface/src/misc/ei_printterm.c b/lib/erl_interface/src/misc/ei_printterm.c
index 98473f780e..5fc6b3542c 100644
--- a/lib/erl_interface/src/misc/ei_printterm.c
+++ b/lib/erl_interface/src/misc/ei_printterm.c
@@ -253,7 +253,8 @@ static int print_term(FILE* fp, ei_x_buff* x,
erlang_big *b;
char *ds;
- b = ei_alloc_big(n);
+ if ( (b = ei_alloc_big(n)) == NULL) goto err;
+
if (ei_decode_big(buf, index, b) < 0) {
ei_free_big(b);
goto err;