Modify mallctl output length when needed

This is the only reason why `oldlenp` was designed to be in the form
of a pointer.
This commit is contained in:
Yinan Zhang
2020-07-22 14:20:38 -07:00
parent 4258402047
commit f5fb4e5a97
2 changed files with 3 additions and 1 deletions

View File

@@ -1494,6 +1494,7 @@ ctl_mtx_assert_held(tsdn_t *tsdn) {
size_t copylen = (sizeof(t) <= *oldlenp) \
? sizeof(t) : *oldlenp; \
memcpy(oldp, (void *)&(v), copylen); \
*oldlenp = copylen; \
ret = EINVAL; \
goto label_return; \
} \