diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-09-01 16:01:42 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-09-01 16:01:42 +0200 |
commit | adc6cd77b77d2eb899f3b946b816e32e747f8255 (patch) | |
tree | e0acc78d9ee4a273eb75f290da942775a2cdf650 | |
parent | 1b4db8ed14c251f06c9722aa13183d5ba89bf6ce (diff) | |
download | fail-adc6cd77b77d2eb899f3b946b816e32e747f8255.tar.gz fail-adc6cd77b77d2eb899f3b946b816e32e747f8255.tar.xz fail-adc6cd77b77d2eb899f3b946b816e32e747f8255.zip |
oom: exit with 3 when malloc returns 0
-rw-r--r-- | fail.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fail.c b/fail.c index 207854a..0ecde49 100644 --- a/fail.c +++ b/fail.c @@ -48,6 +48,10 @@ oom() while (1) { long *m = malloc(4096*4096); + if (!m) { + write(1, "\n", 1); + exit(3); + } m[0] = last; m[1] = c++; last = (long)m; |