mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Don't leak the quoted string returned from dbi_conn_quote_string_copy.
This commit is contained in:
parent
b38be9fe20
commit
5074bd590f
@ -414,14 +414,11 @@ GncDbiSqlConnection::quote_string (const std::string& unquoted_str)
|
||||
|
||||
size = dbi_conn_quote_string_copy (m_conn, unquoted_str.c_str(),
|
||||
"ed_str);
|
||||
if (size != 0)
|
||||
{
|
||||
return std::string{quoted_str};
|
||||
}
|
||||
else
|
||||
{
|
||||
if (quoted_str == nullptr)
|
||||
return std::string{""};
|
||||
}
|
||||
std::string retval{quoted_str};
|
||||
free(quoted_str);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user