diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-01-06 12:30:36 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-01-06 14:59:09 +0100 |
commit | 34680637e838415204850f77c93ca6ca219abaf1 (patch) | |
tree | 4d66191bea180d86800347069feb742140373702 /src/nspawn | |
parent | 9f804ab04d566ff745849e1c4ced680a0447cf76 (diff) | |
download | systemd-34680637e838415204850f77c93ca6ca219abaf1.tar.gz |
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.
Diffstat (limited to 'src/nspawn')
-rw-r--r-- | src/nspawn/nspawn-patch-uid.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nspawn/nspawn-patch-uid.c b/src/nspawn/nspawn-patch-uid.c index 9f36931581..21a1707312 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; |