From 28e8e0c5444d8ec789794098bf4ac89c5ea84171 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 23 Apr 2011 20:38:44 -0400 Subject: [PATCH] Fix some potential memory leaks --- Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp index aec288a9..a9701dfd 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp @@ -2816,6 +2816,7 @@ namespace _VaultRegisterOwnedAge { void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to create AgeLink (async)"); + DEL(param); return; } @@ -2856,9 +2857,10 @@ namespace _VaultRegisterOwnedAge { } void _DownloadCallback(ENetError result, void* param) { - if (IS_NET_ERROR(result)) + if (IS_NET_ERROR(result)) { LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to download age vault (async)"); - else + DEL(param); + } else VaultCreateNode(plVault::kNodeType_AgeLink, (FVaultCreateNodeCallback)_CreateAgeLinkNode, nil, param); } @@ -3174,6 +3176,7 @@ namespace _VaultRegisterVisitAge { void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to create AgeLink (async)"); + DEL(param); return; } @@ -3214,6 +3217,7 @@ namespace _VaultRegisterVisitAge { void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to download age vault (async)"); + DEL(param); return; } @@ -3224,6 +3228,7 @@ namespace _VaultRegisterVisitAge { void _InitAgeCallback(ENetError result, void* state, void* param, UInt32 ageVaultId, UInt32 ageInfoId) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to init age vault (async)"); + DEL(param); return; }