aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2024-09-26 06:02:06 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2024-09-26 06:04:54 +0000
commit3f2792166aeed4baf07d351bcb12a9d196c443eb (patch)
tree520389586cddb4dbdd76f86e0e83d6d70890b511
parentb7b7800043e1dbef65aa9116822010f1a6074f0f (diff)
downloadsrc-3f2792166aee.tar.gz
src-3f2792166aee.zip
MAC: improve consistency in error handling
Whenever mac_syncache_init() returns an error, ensure that *label = NULL. This simplifies the error handling by the caller. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46701
-rw-r--r--sys/security/mac/mac_inet.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/security/mac/mac_inet.c b/sys/security/mac/mac_inet.c
index 29a355071065..9770fa840f95 100644
--- a/sys/security/mac/mac_inet.c
+++ b/sys/security/mac/mac_inet.c
@@ -485,6 +485,7 @@ mac_syncache_init(struct label **label)
MAC_POLICY_PERFORM_NOSLEEP(syncache_destroy_label,
*label);
mac_labelzone_free(*label);
+ *label = NULL;
}
return (error);
} else