Преглед изворни кода

xcap_server: 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 година
родитељ
комит
be58833321
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      src/modules/xcap_server/xcap_server.c

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

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