From: Kern Sibbald Date: Tue, 1 Sep 2009 20:08:11 +0000 (+0200) Subject: Attempt to fix SQLite3 seg fault in list routines X-Git-Tag: Release-7.0.0~2636^2~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1591d9badf7227c2ee22d46c8c505f94cd05d6a4;p=bacula%2Fbacula Attempt to fix SQLite3 seg fault in list routines --- 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) {