mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-26 02:40:43 -06:00
[gnc-backend-dbi.cpp] if returning early, don't allocate char*
this function may return early causing leak from allocating g_build_filename.
This commit is contained in:
parent
9ee3dd9595
commit
b011c81b62
@ -1094,12 +1094,14 @@ gnc_module_init_backend_dbi (void)
|
||||
#endif
|
||||
if (num_drivers <= 0)
|
||||
{
|
||||
#if HAVE_LIBDBI_R
|
||||
if (dbi_instance)
|
||||
return;
|
||||
#endif
|
||||
gchar *libdir = gnc_path_get_libdir ();
|
||||
gchar *dir = g_build_filename (libdir, "dbd", nullptr);
|
||||
g_free (libdir);
|
||||
#if HAVE_LIBDBI_R
|
||||
if (dbi_instance)
|
||||
return;
|
||||
num_drivers = dbi_initialize_r (dir, &dbi_instance);
|
||||
#else
|
||||
num_drivers = dbi_initialize (dir);
|
||||
|
Loading…
Reference in New Issue
Block a user