[c++options] Fix leak.

This commit is contained in:
John Ralls 2023-03-05 10:14:20 -08:00
parent abdd4d9ed7
commit 92071e8844

View File

@ -1261,9 +1261,7 @@ const char*
gnc_option_db_lookup_string_value(GncOptionDB* odb, const char* section, const char* name)
{
auto value{odb->lookup_string_option(section, name)};
if (value.empty())
return nullptr;
return strdup(value.c_str());
return value.empty() ? nullptr : strdup(value.c_str());
}
void