summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-06-07 13:55:43 +0200
committerJim Meyering <meyering@redhat.com>2009-06-07 13:58:24 +0200
commitf9a950b87f996c7f66b5a09e94662cfc9d35bc6d (patch)
treeaa3b6800b24db8a641be7d15ea6f1bb5f1e0ee4e /src
parent5424a74725030c7ddb89e3104e3c730c310379d1 (diff)
downloadcoreutils-f9a950b87f996c7f66b5a09e94662cfc9d35bc6d.tar.xz
sort: die immediately upon heap allocation failure
* src/sort.c (register_proc): Handle hash_insert failure.
Diffstat (limited to 'src')
-rw-r--r--src/sort.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sort.c b/src/sort.c
index 8438c0506..d571ddf02 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -650,7 +650,8 @@ register_proc (pid_t pid)
node->pid = pid;
node->state = ALIVE;
node->count = 1;
- hash_insert (proctab, node);
+ if (hash_insert (proctab, node) == NULL)
+ xalloc_die ();
}
}