e1ee2e
diff -Naur psmisc-22.20.orig/src/pstree.c psmisc-22.20/src/pstree.c
e1ee2e
--- psmisc-22.20.orig/src/pstree.c	2013-10-21 15:31:15.000000000 +0200
e1ee2e
+++ psmisc-22.20/src/pstree.c	2013-10-21 15:30:58.000000000 +0200
e1ee2e
@@ -222,7 +222,12 @@
e1ee2e
     }
e1ee2e
 
e1ee2e
     if (!ptr) {
e1ee2e
-        ptr = malloc(sizeof(*ptr));
e1ee2e
+
e1ee2e
+        if (!(ptr = malloc(sizeof(*ptr)))) {
e1ee2e
+            perror("malloc");
e1ee2e
+            exit(1);
e1ee2e
+        }
e1ee2e
+
e1ee2e
         memset(ptr, 0, sizeof(*ptr));
e1ee2e
         ptr->number = r->ns[id];
e1ee2e
         if (*root == NULL)
e1ee2e
@@ -234,7 +239,12 @@
e1ee2e
     /* move the child to under the namespace's umbrella */
e1ee2e
     for (c = &ptr->children; *c; c = &(*c)->next)
e1ee2e
         ;
e1ee2e
-    *c = malloc(sizeof(CHILD));
e1ee2e
+
e1ee2e
+    if (!(*c = malloc(sizeof(CHILD)))) {
e1ee2e
+        perror("malloc");
e1ee2e
+        exit(1);
e1ee2e
+    }
e1ee2e
+
e1ee2e
     (*c)->child = r;
e1ee2e
     (*c)->next = NULL;
e1ee2e