diff options
author | Sami Kerola <kerolasa@iki.fi> | 2011-10-09 21:29:26 +0200 |
---|---|---|
committer | Sami Kerola <kerolasa@iki.fi> | 2011-12-20 17:30:50 +0100 |
commit | 1ef14f4bf9de937ea97086c8f473d5d08c89a00c (patch) | |
tree | acd5cba53f6eb9358cac46bf89d678374b3c8191 /skill.c | |
parent | 4bd36d1483236f257011082e1824f522df89cd3c (diff) | |
download | procps-ng-1ef14f4bf9de937ea97086c8f473d5d08c89a00c.tar.gz |
includes: add xalloc.h to unify memory allocations
The xalloc.h provides necessary error checking.
Signed-off-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'skill.c')
-rw-r--r-- | skill.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -24,6 +24,7 @@ #include "c.h" #include "nls.h" +#include "xalloc.h" #include "proc/pwcache.h" #include "proc/sig.h" #include "proc/devname.h" @@ -39,8 +40,7 @@ static const char **cmds; static int *pids; #define ENLIST(thing,addme) do{ \ -if(!thing##s) thing##s = malloc(sizeof(*thing##s)*saved_argc); \ -if(!thing##s) fprintf(stderr,_("No memory.\n")),exit(2); \ +if(!thing##s) thing##s = xmalloc(sizeof(*thing##s)*saved_argc); \ thing##s[thing##_count++] = addme; \ }while(0) |