From f5fe04b93a2131bd57f34f4d526e57933caa8a4c Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 31 Aug 2021 00:39:12 +0100 Subject: [PATCH] jail: actually check calloc return value Instead of checking the return value of calloc(), the check intended for that would rather check if the pointer passed as an argument. As that doesn't make much sense, rather actually check calloc() return value. Coverity CID: 1490071 Dereference before null check Signed-off-by: Daniel Golle --- jail/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jail/fs.c b/jail/fs.c index d6aed00..210567e 100644 --- a/jail/fs.c +++ b/jail/fs.c @@ -357,7 +357,7 @@ static int parseOCImountopts(struct blob_attr *msg, unsigned long *mount_flags, if (len) { *mount_data = calloc(len + 1, sizeof(char)); - if (!mount_data) + if (!(*mount_data)) return ENOMEM; len = 0; -- 2.30.2