Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
02da0411
Commit
02da0411
authored
Nov 26, 2012
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Nov 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add helper for string table memory freeing.
parent
380d0cd0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
26 deletions
+17
-26
filemoniker.c
dlls/ole32/filemoniker.c
+17
-26
No files found.
dlls/ole32/filemoniker.c
View file @
02da0411
...
...
@@ -657,6 +657,15 @@ FileMonikerImpl_Reduce(IMoniker* iface, IBindCtx* pbc, DWORD dwReduceHowFar,
return
MK_S_REDUCED_TO_SELF
;
}
static
void
free_stringtable
(
LPOLESTR
*
stringTable
)
{
int
i
;
for
(
i
=
0
;
stringTable
[
i
]
!=
NULL
;
i
++
)
CoTaskMemFree
(
stringTable
[
i
]);
CoTaskMemFree
(
stringTable
);
}
/******************************************************************************
* FileMoniker_ComposeWith
*/
...
...
@@ -731,12 +740,8 @@ FileMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight,
}
else
res
=
E_OUTOFMEMORY
;
for
(
i
=
0
;
strDec1
[
i
]
!=
NULL
;
i
++
)
CoTaskMemFree
(
strDec1
[
i
]);
for
(
i
=
0
;
strDec2
[
i
]
!=
NULL
;
i
++
)
CoTaskMemFree
(
strDec2
[
i
]);
CoTaskMemFree
(
strDec1
);
CoTaskMemFree
(
strDec2
);
free_stringtable
(
strDec1
);
free_stringtable
(
strDec2
);
CoTaskMemFree
(
str1
);
CoTaskMemFree
(
str2
);
...
...
@@ -1004,17 +1009,9 @@ FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** p
{
for
(
i
=
0
;
i
<
sameIdx
;
i
++
)
strcatW
(
commonPath
,
stringTable1
[
i
]);
for
(
i
=
0
;
i
<
nb1
;
i
++
)
CoTaskMemFree
(
stringTable1
[
i
]);
CoTaskMemFree
(
stringTable1
);
for
(
i
=
0
;
i
<
nb2
;
i
++
)
CoTaskMemFree
(
stringTable2
[
i
]);
CoTaskMemFree
(
stringTable2
);
free_stringtable
(
stringTable1
);
free_stringtable
(
stringTable2
);
ret
=
CreateFileMoniker
(
commonPath
,
ppmkPrefix
);
}
HeapFree
(
GetProcessHeap
(),
0
,
commonPath
);
...
...
@@ -1167,12 +1164,8 @@ FileMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppm
res
=
CreateFileMoniker
(
relPath
,
ppmkRelPath
);
for
(
j
=
0
;
tabStr1
[
j
]
!=
NULL
;
j
++
)
CoTaskMemFree
(
tabStr1
[
j
]);
for
(
j
=
0
;
tabStr2
[
j
]
!=
NULL
;
j
++
)
CoTaskMemFree
(
tabStr2
[
j
]);
CoTaskMemFree
(
tabStr1
);
CoTaskMemFree
(
tabStr2
);
free_stringtable
(
tabStr1
);
free_stringtable
(
tabStr2
);
CoTaskMemFree
(
str1
);
CoTaskMemFree
(
str2
);
HeapFree
(
GetProcessHeap
(),
0
,
relPath
);
...
...
@@ -1410,9 +1403,7 @@ static HRESULT FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa
strcatW
(
This
->
filePathName
,
bkSlash
);
}
for
(
i
=
0
;
tabStr
[
i
]
!=
NULL
;
i
++
)
CoTaskMemFree
(
tabStr
[
i
]);
CoTaskMemFree
(
tabStr
);
free_stringtable
(
tabStr
);
return
S_OK
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment