From cc5b9e03d48177aeeafdf9d5bd9e51f7963eae56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 22 Nov 2014 13:04:04 +0000 Subject: Steam: Fix json memleaks all over code; version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@11037 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_pooling.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'protocols/Steam/src/steam_pooling.cpp') diff --git a/protocols/Steam/src/steam_pooling.cpp b/protocols/Steam/src/steam_pooling.cpp index 93ef78e726..15d39f8cbe 100644 --- a/protocols/Steam/src/steam_pooling.cpp +++ b/protocols/Steam/src/steam_pooling.cpp @@ -198,15 +198,16 @@ void CSteamProto::PollingThread(void*) messageId = json_as_int(node); node = json_get(root, "messages"); - root = json_as_array(node); + JSONNODE *nroot = json_as_array(node); - if (root != NULL) - ParsePollData(root); + if (nroot != NULL) + ParsePollData(nroot); m_pollingConnection = response->nlc; } else if (!lstrcmpi(error, L"Timeout")) { + json_delete(root); continue; } else if (!lstrcmpi(error, L"Not Logged On")) @@ -233,6 +234,7 @@ void CSteamProto::PollingThread(void*) breaked = true; } + json_delete(root); CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)response); } -- cgit v1.2.3