summaryrefslogtreecommitdiff
path: root/plugins/Utils.pas
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-30 13:45:23 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-30 13:45:23 +0000
commit844a07146a7c4f97898b7dc4a510b78fe0cbfcfb (patch)
tree7dfedfea2c444032e0a287680bd83f3fa68c013a /plugins/Utils.pas
parente2d393ac442287191c9da50db012436f576c67e8 (diff)
fix for a memleak
git-svn-id: http://svn.miranda-ng.org/main/trunk@5193 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Utils.pas')
-rw-r--r--plugins/Utils.pas/mirutils.pas12
1 files 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]);