Skip to content

Commit

Permalink
[gnc-xml-backend.cpp] gchar* must be freed after use.
Browse files Browse the repository at this point in the history
It is used as a constructor for std::string which makes a copy but
doesn't take ownership.
  • Loading branch information
christopherlam committed Mar 20, 2022
1 parent 7fbbd6e commit 4a75baa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libgnucash/backend/xml/gnc-xml-backend.cpp
Expand Up @@ -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())
{
Expand Down

0 comments on commit 4a75baa

Please sign in to comment.