]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: s/calloc/zalloc/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 28 Jan 2021 17:13:54 +0000 (18:13 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 28 Jan 2021 17:13:54 +0000 (18:13 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c

index 3b2f49ee3e55dccb01e9890c6e762043d5fa0262..e69338f0ac700ef9673b9e8b76bf41857daae833 100644 (file)
@@ -84,7 +84,7 @@ static struct attach_context *get_attach_context(pid_t pid)
        if (!proc_file)
                return log_error_errno(NULL, errno, "Failed to open %s", proc_fn);
 
-       info = calloc(1, sizeof(*info));
+       info = zalloc(sizeof(*info));
        if (!info)
                return NULL;
 
@@ -269,7 +269,7 @@ static int lxc_attach_set_environment(struct attach_context *ctx,
                        for (count = 0; extra_keep[count]; count++)
                                ;
 
-                       extra_keep_store = calloc(count, sizeof(char *));
+                       extra_keep_store = zalloc(count * sizeof(char *));
                        if (!extra_keep_store)
                                return -1;