RevEmuAPI: Fix potential memleak, and change indents slighty.

This commit is contained in:
zaCade 2019-03-02 13:20:22 +01:00
parent 9d07106068
commit 1e6113c90f

View File

@ -160,9 +160,9 @@ static cell_t GetPlayerType(IPluginContext *pContext, const cell_t *params)
*/ */
const sp_nativeinfo_t g_ExtensionNatives[] = const sp_nativeinfo_t g_ExtensionNatives[] =
{ {
{ "RevEmu_IsPlayerSteam", IsPlayerSteam }, { "RevEmu_IsPlayerSteam", IsPlayerSteam },
{ "RevEmu_GetPlayerType", GetPlayerType }, { "RevEmu_GetPlayerType", GetPlayerType },
{ NULL, NULL } { NULL, NULL }
}; };
/** /**
@ -196,6 +196,8 @@ bool RevEmuAPI::SDK_OnLoad(char *error, size_t maxlength, bool late)
if (Rev_BGetPlayerInfoByUserID == NULL) if (Rev_BGetPlayerInfoByUserID == NULL)
{ {
snprintf(error, maxlength, "Unable to find emulator symbol. 'Rev_BGetPlayerInfoByUserID'"); snprintf(error, maxlength, "Unable to find emulator symbol. 'Rev_BGetPlayerInfoByUserID'");
pLibSteamClient->CloseLibrary();
return false; return false;
} }
@ -204,6 +206,8 @@ bool RevEmuAPI::SDK_OnLoad(char *error, size_t maxlength, bool late)
if (Rev_BGetPlayerInfoBySteamID == NULL) if (Rev_BGetPlayerInfoBySteamID == NULL)
{ {
snprintf(error, maxlength, "Unable to find emulator symbol. 'Rev_BGetPlayerInfoBySteamID'"); snprintf(error, maxlength, "Unable to find emulator symbol. 'Rev_BGetPlayerInfoBySteamID'");
pLibSteamClient->CloseLibrary();
return false; return false;
} }