Просмотр исходного кода

pua: 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 лет назад
Родитель
Сommit
e5085c9c08
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      src/modules/pua/pua.c

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

@@ -198,7 +198,9 @@ static int mod_init(void)
 	}
 	/* verify table version  */
 	if(db_check_table_version(&pua_dbf, pua_db, &db_table, PUA_TABLE_VERSION) < 0) {
-		LM_ERR("error during table version check.\n");
+		DB_TABLE_VERSION_ERROR(db_table);
+		pua_dbf.close(pua_db);
+		pua_db = NULL;
 		return -1;
 	}