From: Lennart Poettering Date: Fri, 6 Jan 2023 11:30:36 +0000 (+0100) Subject: nspawn: guard acl_free() with a NULL check X-Git-Tag: v253-rc1~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34680637e838415204850f77c93ca6ca219abaf1;p=thirdparty%2Fsystemd.git nspawn: guard acl_free() with a NULL check Inspired by #25957 there's one other place where we don't guard acl_free() calls with a NULL check. Fix that. --- diff --git a/src/nspawn/nspawn-patch-uid.c b/src/nspawn/nspawn-patch-uid.c index 9f369315810..21a17073127 100644 --- a/src/nspawn/nspawn-patch-uid.c +++ b/src/nspawn/nspawn-patch-uid.c @@ -181,7 +181,9 @@ static int patch_acls(int fd, const char *name, const struct stat *st, uid_t shi if (S_ISDIR(st->st_mode)) { acl_free(acl); - acl_free(shifted); + + if (shifted) + acl_free(shifted); acl = shifted = NULL;