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.
This commit is contained in:
Lennart Poettering
2023-01-06 14:59:09 +01:00
parent 9f804ab04d
commit 34680637e8
+3 -1
View File
@@ -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;