aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-08-04 11:32:52 +0200
committerLukas Larsson <[email protected]>2014-08-06 11:44:47 +0200
commitad57501215fc02a39abf3fbce978dbc43d010859 (patch)
tree230d290a4bf8489962329be1c6d7e8b8008a560c /erts/emulator/beam/utils.c
parent62081266545df8f5eda8e2043f33055cfe575126 (diff)
downloadotp-ad57501215fc02a39abf3fbce978dbc43d010859.tar.gz
otp-ad57501215fc02a39abf3fbce978dbc43d010859.tar.bz2
otp-ad57501215fc02a39abf3fbce978dbc43d010859.zip
erts: Print error reason when malloc fails
Diffstat (limited to 'erts/emulator/beam/utils.c')
-rw-r--r--erts/emulator/beam/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 72092ec7b0..55f9e68e78 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -3948,6 +3948,9 @@ erts_save_emu_args(int argc, char **argv)
size += sz+1;
}
ptr = (char *) malloc(size);
+ if (!ptr) {
+ ERTS_INTERNAL_ERROR("malloc failed to allocate memory!");
+ }
#ifdef DEBUG
end_ptr = ptr + size;
#endif