Browse Source

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 years ago
parent
commit
be58833321
1 changed files with 3 additions and 1 deletions
  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,
 				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;
 	}
 	xcaps_dbf.close(xcaps_db);