Browse Source

siptrace: 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 6 năm trước cách đây
mục cha
commit
0fd45d23b4
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      src/modules/siptrace/siptrace.c

+ 2 - 1
src/modules/siptrace/siptrace.c

@@ -426,8 +426,9 @@ static int child_init(int rank)
 		if(db_check_table_version(
 		if(db_check_table_version(
 				   &db_funcs, db_con, &siptrace_table, SIP_TRACE_TABLE_VERSION)
 				   &db_funcs, db_con, &siptrace_table, SIP_TRACE_TABLE_VERSION)
 				< 0) {
 				< 0) {
-			LM_ERR("error during table version check\n");
+			DB_TABLE_VERSION_ERROR(siptrace_table);
 			db_funcs.close(db_con);
 			db_funcs.close(db_con);
+			db_con = 0;
 			return -1;
 			return -1;
 		}
 		}
 	}
 	}