summaryrefslogtreecommitdiff
path: root/sys/security
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2009-03-14 20:40:06 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2009-03-14 20:40:06 +0000
commita3ce3b6d35ac6808f2799b90c2db8eb2f3d5e62d (patch)
treefe0d2395d13c8216fd09352f7797c6411ee100c2 /sys/security
parentb3c11b5b91d41ce98b4934fdb70c047cc30377ca (diff)
Notes
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/mac_portacl/mac_portacl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/security/mac_portacl/mac_portacl.c b/sys/security/mac_portacl/mac_portacl.c
index aceda6908b14..f54319aca939 100644
--- a/sys/security/mac_portacl/mac_portacl.c
+++ b/sys/security/mac_portacl/mac_portacl.c
@@ -341,10 +341,12 @@ sysctl_rules(SYSCTL_HANDLER_ARGS)
int error;
new_string = NULL;
- if (req->newptr == NULL) {
+ if (req->newptr != NULL) {
new_string = malloc(MAC_RULE_STRING_LEN, M_PORTACL,
M_WAITOK | M_ZERO);
+ mtx_lock(&rule_mtx);
strcpy(new_string, rule_string);
+ mtx_unlock(&rule_mtx);
string = new_string;
} else
string = rule_string;