Explorar o código

msilo: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)
Henning Westerholt %!s(int64=6) %!d(string=hai) anos
pai
achega
21e24b1642
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/modules/msilo/msilo.c

+ 3 - 1
src/modules/msilo/msilo.c

@@ -335,7 +335,9 @@ static int mod_init(void)
 	}
 
 	if(db_check_table_version(&msilo_dbf, db_con, &ms_db_table, S_TABLE_VERSION) < 0) {
-		LM_ERR("error during table version check.\n");
+		DB_TABLE_VERSION_ERROR(ms_db_table);
+		msilo_dbf.close(db_con);
+		db_con = NULL;
 		return -1;
 	}
 	if(db_con)