diff --git a/dlls/mysqlx/module.cpp b/dlls/mysqlx/module.cpp index a8b05864..d3147653 100644 --- a/dlls/mysqlx/module.cpp +++ b/dlls/mysqlx/module.cpp @@ -8,7 +8,7 @@ void OnAmxxAttach() MF_AddNatives(g_BaseSqlNatives); MF_AddNatives(g_ThreadSqlNatives); MF_RegisterFunction(&g_Mysql, "GetSqlDriver"); - if (!MF_RequestFunction("GetDbDriver") || !MF_FindLibrary("SQLITE", LibType_Library)) + if (!MF_RequestFunction("GetDbDriver") && !MF_FindLibrary("SQLITE", LibType_Library)) { MF_AddNatives(g_OldCompatNatives); MF_AddLibraries("dbi", LibType_Class, &g_ident); diff --git a/dlls/mysqlx/oldcompat_sql.cpp b/dlls/mysqlx/oldcompat_sql.cpp index 9b330c40..3e283447 100644 --- a/dlls/mysqlx/oldcompat_sql.cpp +++ b/dlls/mysqlx/oldcompat_sql.cpp @@ -327,6 +327,12 @@ static cell AMX_NATIVE_CALL dbi_free_result(AMX *amx, cell *params) { cell *_r = MF_GetAmxAddr(amx, params[1]); cell num = *_r; + + if (!num) + { + return 1; + } + oldresult_s *oldrs = (oldresult_s *)GetHandle(num, Handle_OldResult); if (!oldrs) {