From 844a07146a7c4f97898b7dc4a510b78fe0cbfcfb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Jun 2013 13:45:23 +0000 Subject: fix for a memleak git-svn-id: http://svn.miranda-ng.org/main/trunk@5193 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Utils.pas/mirutils.pas | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas index 4e45e08fe2..0ac1750e76 100644 --- a/plugins/Utils.pas/mirutils.pas +++ b/plugins/Utils.pas/mirutils.pas @@ -750,7 +750,7 @@ end; // Import plugin function adaptation function CreateGroupW(name:pWideChar;hContact:THANDLE):integer; var - groupId:integer; + groupId, res:integer; groupIdStr:array [0..10] of AnsiChar; grbuf:array [0..127] of WideChar; p, pw:pWideChar; @@ -771,7 +771,9 @@ begin if pw=nil then break; - if StrCmpW(pw+1,@grbuf[1])=0 then + res:=StrCmpW(pw+1,@grbuf[1]); + mFreeMem(pw); + if res=0 then begin if hContact<>0 then DBWriteUnicode(hContact,strCList,clGroup,@grbuf[1]); @@ -800,7 +802,7 @@ end; function CreateGroup(name:pAnsiChar;hContact:THANDLE):integer; var - groupId:integer; + groupId, res:integer; groupIdStr:array [0..10] of AnsiChar; grbuf:array [0..127] of AnsiChar; p, pa:pAnsiChar; @@ -821,7 +823,9 @@ begin if pa=nil then break; - if StrCmp(pa+1,@grbuf[1])=0 then + res:=StrCmp(pa+1,@grbuf[1]); + mFreeMem(pa); + if res=0 then begin if hContact<>0 then DBWriteString(hContact,strCList,clGroup,@grbuf[1]); -- cgit v1.2.3