From 1e6113c90f4d23a1e94edaf45f0d6e0485bd9e47 Mon Sep 17 00:00:00 2001 From: zaCade Date: Sat, 2 Mar 2019 13:20:22 +0100 Subject: [PATCH] RevEmuAPI: Fix potential memleak, and change indents slighty. --- extension.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/extension.cpp b/extension.cpp index 267512c..a821ade 100644 --- a/extension.cpp +++ b/extension.cpp @@ -160,9 +160,9 @@ static cell_t GetPlayerType(IPluginContext *pContext, const cell_t *params) */ const sp_nativeinfo_t g_ExtensionNatives[] = { - { "RevEmu_IsPlayerSteam", IsPlayerSteam }, - { "RevEmu_GetPlayerType", GetPlayerType }, - { NULL, NULL } + { "RevEmu_IsPlayerSteam", IsPlayerSteam }, + { "RevEmu_GetPlayerType", GetPlayerType }, + { NULL, NULL } }; /** @@ -196,6 +196,8 @@ bool RevEmuAPI::SDK_OnLoad(char *error, size_t maxlength, bool late) if (Rev_BGetPlayerInfoByUserID == NULL) { snprintf(error, maxlength, "Unable to find emulator symbol. 'Rev_BGetPlayerInfoByUserID'"); + + pLibSteamClient->CloseLibrary(); return false; } @@ -204,6 +206,8 @@ bool RevEmuAPI::SDK_OnLoad(char *error, size_t maxlength, bool late) if (Rev_BGetPlayerInfoBySteamID == NULL) { snprintf(error, maxlength, "Unable to find emulator symbol. 'Rev_BGetPlayerInfoBySteamID'"); + + pLibSteamClient->CloseLibrary(); return false; }