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-5.0.0~319^2~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9d934a65c764d2b47dbe128dbdbed16cf5382d24;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) {