Browse Source

* Closed database connection after two error case. Thanks to Jan for
pointing out the bug.

Juha Heinanen 16 years ago
parent
commit
f3e18e3885
1 changed files with 2 additions and 0 deletions
  1. 2 0
      modules/lcr/lcr_mod.c

+ 2 - 0
modules/lcr/lcr_mod.c

@@ -1052,6 +1052,7 @@ int reload_gws_and_lcrs(void)
     }
 
     if (lcr_dbf.use_table(dbh, &gw_table) < 0) {
+	lcr_dbf.close(dbh);
 	LM_ERR("error while trying to use gw table\n");
 	return -1;
     }
@@ -1273,6 +1274,7 @@ int reload_gws_and_lcrs(void)
     }
 
     if (lcr_dbf.use_table(dbh, &lcr_table) < 0) {
+	lcr_dbf.close(dbh);
 	LM_ERR("error while trying to use lcr table\n");
 	return -1;
     }