Fix test-backend-dbi segfault with libdbi-0.9.0.

dbi_inst must be initialized before it can be used.
This commit is contained in:
John Ralls 2014-08-07 11:46:17 -07:00
parent 551e5c6093
commit e4d97f6d74

View File

@ -36,7 +36,7 @@
#if LIBDBI_VERSION >= 900
#define HAVE_LIBDBI_R 1
static dbi_inst dbi_instance;
static dbi_inst dbi_instance = NULL;
#else
#define HAVE_LIBDBI_R 0
#endif
@ -597,8 +597,11 @@ test_suite_gnc_backend_dbi (void)
dbi_driver driver = NULL;
GList *drivers = NULL;
#if HAVE_LIBDBI_R
if (dbi_instance == NULL)
dbi_initialize_r (NULL, &dbi_instance);
while ((driver = dbi_driver_list_r (driver, dbi_instance)))
#else
dbi_initialize (NULL);
while ((driver = dbi_driver_list (driver)))
#endif
{