[gnc-xml-backend.cpp] gchar* must be freed after use.

It is used as a constructor for std::string which makes a copy but
doesn't take ownership.
This commit is contained in:
Christopher Lam 2022-03-20 23:12:32 +08:00
parent 7fbbd6e745
commit 4a75baa4c6

View File

@ -116,7 +116,9 @@ GncXmlBackend::session_begin(QofSession* session, const char* new_uri,
SessionOpenMode mode)
{
/* Make sure the directory is there */
m_fullpath = gnc_uri_get_path (new_uri);
auto path_str = gnc_uri_get_path (new_uri);
m_fullpath = path_str;
g_free (path_str);
if (m_fullpath.empty())
{