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:
Puck Meerburg 2015-01-16 20:42:15 +01:00 committed by Adrien Destugues
parent 19ce061e0b
commit 14d1920039

View File

@ -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);