Fix memory leak: Missing regfree() after regcomp().

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22070 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2012-03-08 21:20:07 +00:00
parent 4d871fc9fd
commit af0709b732
2 changed files with 2 additions and 0 deletions

View File

@ -928,6 +928,7 @@ gnc_xml_be_remove_old_files(FileBackend *be)
else if (regexec(&pattern, stamp_start, 0, NULL, 0) == 0) else if (regexec(&pattern, stamp_start, 0, NULL, 0) == 0)
got_date_stamp = TRUE; got_date_stamp = TRUE;
regfree(&pattern);
g_free(expression); g_free(expression);
if (!got_date_stamp) /* Not a gnucash created file after all... */ if (!got_date_stamp) /* Not a gnucash created file after all... */

View File

@ -179,6 +179,7 @@ extract_machine_name( const gchar* path )
machine = g_strndup( path + match[1].rm_so, match[1].rm_eo - match[1].rm_so ); machine = g_strndup( path + match[1].rm_so, match[1].rm_eo - match[1].rm_so );
} }
} }
regfree(&compiled_m);
return machine; return machine;
} }