aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/legacy/erl_marshal.c
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/legacy/erl_marshal.c
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/legacy/erl_marshal.c')
-rw-r--r--lib/erl_interface/src/legacy/erl_marshal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c
index 18315bfbd3..5084c65230 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.c
+++ b/lib/erl_interface/src/legacy/erl_marshal.c
@@ -1890,8 +1890,11 @@ static int cmp_big_big(unsigned char**e1, unsigned char **e2)
ei_get_type((char *)*e1,&i1,&t1,&n1);
ei_get_type((char *)*e2,&i2,&t2,&n2);
- b1 = ei_alloc_big(n1);
- b2 = ei_alloc_big(n2);
+ if ( (b1 = ei_alloc_big(n1)) == NULL) return -1;
+ if ( (b2 = ei_alloc_big(n2)) == NULL) {
+ ei_free_big(b1);
+ return 1;
+ }
ei_decode_big((char *)*e1,&i1,b1);
ei_decode_big((char *)*e2,&i2,b2);