In all cases except CTLTYPE_STRING, penv is NULL here, so passing it
indiscriminately to printf() and freeenv() is incorrect. Add a NULL check before freeenv(); as for printf(), we could use req.newptr instead, but we'd have to select the correct format string based on the type, and that's too much work for an error message, so just remove it.
This commit is contained in:
parent
c412a56aca
commit
b0d69dfad9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273564
@ -280,11 +280,10 @@ sysctl_load_tunable_by_oid_locked(struct sysctl_oid *oidp)
|
||||
}
|
||||
error = sysctl_root_handler_locked(oidp, oidp->oid_arg1,
|
||||
oidp->oid_arg2, &req);
|
||||
if (error != 0) {
|
||||
printf("Setting sysctl '%s' to '%s' failed: %d\n",
|
||||
path, penv, error);
|
||||
}
|
||||
freeenv(penv);
|
||||
if (error != 0)
|
||||
printf("Setting sysctl %s failed: %d\n", path, error);
|
||||
if (penv != NULL)
|
||||
freeenv(penv);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user