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
2e4242b5
Commit
2e4242b5
authored
Nov 08, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Nov 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: If a decoding function failed, free the memory allocated for it.
parent
4c981e20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
decode.c
dlls/crypt32/decode.c
+12
-0
No files found.
dlls/crypt32/decode.c
View file @
2e4242b5
...
...
@@ -231,6 +231,14 @@ static BOOL CRYPT_DecodeEnsureSpace(DWORD dwFlags,
return
ret
;
}
static
void
CRYPT_FreeSpace
(
PCRYPT_DECODE_PARA
pDecodePara
,
LPVOID
pv
)
{
if
(
pDecodePara
&&
pDecodePara
->
pfnFree
)
pDecodePara
->
pfnFree
(
pv
);
else
LocalFree
(
pv
);
}
/* Helper function to check *pcbStructInfo and set it to the required size.
* Assumes pvStructInfo is not NULL.
*/
...
...
@@ -540,6 +548,8 @@ static BOOL CRYPT_AsnDecodeSequence(struct AsnDecodeSequenceItem items[],
ret
=
CRYPT_AsnDecodeSequenceItems
(
items
,
cItem
,
ptr
,
dataLen
,
dwFlags
,
pvStructInfo
,
nextData
,
&
cbDecoded
);
if
(
!
ret
&&
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
CRYPT_FreeSpace
(
pDecodePara
,
pvStructInfo
);
}
}
}
...
...
@@ -727,6 +737,8 @@ static BOOL CRYPT_AsnDecodeArray(const struct AsnArrayDescriptor *arrayDesc,
ptr
+=
itemDecoded
;
}
}
if
(
!
ret
&&
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
CRYPT_FreeSpace
(
pDecodePara
,
pvStructInfo
);
}
}
if
(
itemSizes
!=
&
itemSize
)
...
...
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