]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
sort: die immediately upon heap allocation failure
authorJim Meyering <meyering@redhat.com>
Sun, 7 Jun 2009 11:55:43 +0000 (13:55 +0200)
committerJim Meyering <meyering@redhat.com>
Sun, 7 Jun 2009 11:58:24 +0000 (13:58 +0200)
* src/sort.c (register_proc): Handle hash_insert failure.

src/sort.c

index 8438c0506bf539f83d6e60951fccd10ba53540b3..d571ddf0238e2374b3d7f326d9a387927a06cc76 100644 (file)
@@ -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 ();
     }
 }