bindfs: Keep settings in scope for the entire Mount operation
Signed-off-by: Adrien Destugues <pulkomandy@gmail.com> * Fixes #11760. * Bug made visible by the changes to fix private driver settings. Before the change, the settings were most often leaked, so there was no use-after-free.
This commit is contained in:
parent
19ce061e0b
commit
14d1920039
@ -51,10 +51,10 @@ Volume::Mount(const char* parameterString)
|
||||
{
|
||||
const char* source = NULL;
|
||||
void* parameterHandle = parse_driver_settings_string(parameterString);
|
||||
if (parameterHandle != NULL) {
|
||||
CObjectDeleter<void, status_t> parameterDeleter(parameterHandle,
|
||||
delete_driver_settings);
|
||||
if (parameterHandle != NULL)
|
||||
source = get_driver_parameter(parameterHandle, "source", NULL, NULL);
|
||||
delete_driver_settings(parameterHandle);
|
||||
}
|
||||
if (source == NULL || source[0] == '\0') {
|
||||
ERROR("need source folder ('source' parameter)!\n");
|
||||
RETURN_ERROR(B_BAD_VALUE);
|
||||
|
Loading…
Reference in New Issue
Block a user