aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/misc
diff options
context:
space:
mode:
authorMichael Santos <[email protected]>2010-10-28 20:45:09 -0400
committerBjörn Gustavsson <[email protected]>2010-10-29 15:31:50 +0200
commit3a1c6808c41243552915f841ec885d6ecf97ebd6 (patch)
tree57a2053bcc6dbd5a6972903796c5e305c2ecf0e7 /lib/erl_interface/src/misc
parent76378bb4a1a89d08b41d6f3df0edc6c26160bef7 (diff)
downloadotp-3a1c6808c41243552915f841ec885d6ecf97ebd6.tar.gz
otp-3a1c6808c41243552915f841ec885d6ecf97ebd6.tar.bz2
otp-3a1c6808c41243552915f841ec885d6ecf97ebd6.zip
ei: error if return value of ei_alloc_big is NULL
Diffstat (limited to 'lib/erl_interface/src/misc')
-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;