[lxc-devel] [lxcfs/master] bindings: use zalloc()
brauner on Github
lxc-bot at linuxcontainers.org
Thu Apr 16 17:16:44 UTC 2020
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 390 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200416/8786be70/attachment.bin>
-------------- next part --------------
From 5ec289bfd2a9469e45d07c251762c6b1c3bb3f41 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Thu, 16 Apr 2020 19:12:34 +0200
Subject: [PATCH] bindings: use zalloc()
Fixes: Coverity 355747.
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
src/bindings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bindings.c b/src/bindings.c
index 0c19739..89ebde5 100644
--- a/src/bindings.c
+++ b/src/bindings.c
@@ -274,7 +274,7 @@ static void save_initpid(ino_t pidns_inode, pid_t pid)
if (stat(path, &st))
return;
- entry = malloc(sizeof(*entry));
+ entry = zalloc(sizeof(*entry));
if (!entry)
return;
More information about the lxc-devel
mailing list