If key not found, strdup default value, too
This commit is contained in:
1 parent
3e2419ebe3
commit
fdead26ffe
1 file changed
+2
-6
@@ -453,14 +453,10 @@ METHOD(settings_t, alloc_str, char*,
|
||||
va_start(args, def);
|
||||
/* additional lock to savely strdup */
|
||||
this->lock->read_lock(this->lock);
|
||||
value = strdupnull(find_value(this, this->top, key, args));
|
||||
value = strdupnull(find_value(this, this->top, key, args) ?: def);
|
||||
this->lock->unlock(this->lock);
|
||||
va_end(args);
|
||||
if (value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
return def;
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user