浏览代码

xcap_client: 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 年之前
父节点
当前提交
8838648d9f
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/modules/xcap_client/xcap_client.c

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

@@ -140,7 +140,9 @@ static int mod_init(void)
 
 	if(db_check_table_version(&xcap_dbf, xcap_db, &xcap_db_table,
 				XCAP_TABLE_VERSION) < 0) {
-		LM_ERR("error during table version check.\n");
+		DB_TABLE_VERSION_ERROR(xcap_db_table);
+		xcap_dbf.close(xcap_db);
+		xcap_db = NULL;
 		return -1;
 	}
 	xcap_dbf.close(xcap_db);