From 1591d9badf7227c2ee22d46c8c505f94cd05d6a4 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 1 Sep 2009 22:08:11 +0200 Subject: [PATCH] Attempt to fix SQLite3 seg fault in list routines --- bacula/src/cats/sqlite.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bacula/src/cats/sqlite.c b/bacula/src/cats/sqlite.c index 9d8c96343f..ae618c7e29 100644 --- a/bacula/src/cats/sqlite.c +++ b/bacula/src/cats/sqlite.c @@ -403,9 +403,15 @@ void my_sqlite_free_table(B_DB *mdb) if (mdb->fields_defined) { for (i=0; i < sql_num_fields(mdb); i++) { - free(mdb->fields[i]); + if (mdb->fileds[i]) { + free(mdb->fields[i]); + mdb->fields[i] = NULL; + } + } + if (mbd->fields) { + free(mdb->fields); + mdb->fields = NULL; } - free(mdb->fields); mdb->fields_defined = false; } if (mdb->result) { -- 2.39.5