Explorar o código

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

Juha Heinanen %!s(int64=16) %!d(string=hai) anos
pai
achega
f3e18e3885
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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;
     }