]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsns: use xcalloc()
authorRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 17 Feb 2016 19:58:23 +0000 (20:58 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 18 Feb 2016 15:54:26 +0000 (16:54 +0100)
... found by tools/checkxalloc.sh

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
sys-utils/lsns.c

index 7b8f17d559cc1e35023b0c2e7d7628f90c5d06f8..71ae3f99e0bdf0cec93a720e138136035957eb80 100644 (file)
@@ -233,7 +233,7 @@ static int read_process(struct lsns *ls, pid_t pid)
        if (!dir)
                return -errno;
 
-       p = calloc(1, sizeof(*p));
+       p = xcalloc(1, sizeof(*p));
        if (!p) {
                rc = -ENOMEM;
                goto done;
@@ -338,7 +338,7 @@ static int namespace_has_process(struct lsns_namespace *ns, pid_t pid)
 
 static struct lsns_namespace *add_namespace(struct lsns *ls, int type, ino_t ino)
 {
-       struct lsns_namespace *ns = calloc(1, sizeof(*ns));
+       struct lsns_namespace *ns = xcalloc(1, sizeof(*ns));
 
        if (!ns)
                return NULL;