From: Kern Sibbald Date: Mon, 1 Feb 2010 17:52:00 +0000 (+0100) Subject: Free db_list when not used X-Git-Tag: Release-5.0.1~139 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f4860708e2d635862b6e198b61b6904c3e696b23;p=bacula%2Fbacula Free db_list when not used --- diff --git a/bacula/src/cats/dbi.c b/bacula/src/cats/dbi.c index 16e7546bd4..11f4003329 100644 --- a/bacula/src/cats/dbi.c +++ b/bacula/src/cats/dbi.c @@ -372,6 +372,10 @@ db_close_database(JCR *jcr, B_DB *mdb) free(mdb->db_driver); } free(mdb); + if (db_list->size() == 0) { + delete db_list; + db_list = NULL; + } } V(mutex); } diff --git a/bacula/src/cats/ingres.c b/bacula/src/cats/ingres.c index 5a9291847e..4cf709b26e 100755 --- a/bacula/src/cats/ingres.c +++ b/bacula/src/cats/ingres.c @@ -273,6 +273,10 @@ db_close_database(JCR *jcr, B_DB *mdb) free(mdb->db_socket); } free(mdb); + if (db_list->size() == 0) { + delete db_list; + db_list = NULL; + } } V(mutex); } diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index 994e0e5485..a2a355b214 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2008 Free Software Foundation Europe e.V. + Copyright (C) 2000-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -32,7 +32,6 @@ * * Kern Sibbald, March 2000 * - * Version $Id$ */ @@ -269,6 +268,10 @@ db_close_database(JCR *jcr, B_DB *mdb) free(mdb->db_socket); } free(mdb); + if (db_list->size() == 0) { + delete db_list; + db_list = NULL; + } } V(mutex); } diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index c5757efced..c0d52cb2e6 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -290,6 +290,10 @@ db_close_database(JCR *jcr, B_DB *mdb) free(mdb->db_socket); } free(mdb); + if (db_list->size() == 0) { + delete db_list; + db_list = NULL; + } } V(mutex); } diff --git a/bacula/src/cats/sqlite.c b/bacula/src/cats/sqlite.c index d18b24e891..2e07ace931 100644 --- a/bacula/src/cats/sqlite.c +++ b/bacula/src/cats/sqlite.c @@ -261,6 +261,10 @@ db_close_database(JCR *jcr, B_DB *mdb) free(mdb->db_name); } free(mdb); + if (db_list->size() == 0) { + delete db_list; + db_list = NULL; + } } V(mutex); }