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
6b266a76
Commit
6b266a76
authored
Jul 14, 2007
by
Alec Berryman
Committed by
Alexandre Julliard
Jul 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
itss: Replace malloc/free with HeapAlloc/HeapFree.
parent
76061f40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
chm_lib.c
dlls/itss/chm_lib.c
+16
-13
No files found.
dlls/itss/chm_lib.c
View file @
6b266a76
...
...
@@ -627,8 +627,8 @@ static void chm_set_param(struct chmFile *h,
int
i
;
/* allocate new cached blocks */
newBlocks
=
malloc
(
paramVal
*
sizeof
(
UChar
*
));
newIndices
=
malloc
(
paramVal
*
sizeof
(
UInt64
));
newBlocks
=
HeapAlloc
(
GetProcessHeap
(),
0
,
paramVal
*
sizeof
(
UChar
*
));
newIndices
=
HeapAlloc
(
GetProcessHeap
(),
0
,
paramVal
*
sizeof
(
UInt64
));
for
(
i
=
0
;
i
<
paramVal
;
i
++
)
{
newBlocks
[
i
]
=
NULL
;
...
...
@@ -647,7 +647,7 @@ static void chm_set_param(struct chmFile *h,
/* in case of collision, destroy newcomer */
if
(
newBlocks
[
newSlot
])
{
free
(
h
->
cache_blocks
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
h
->
cache_blocks
[
i
]);
h
->
cache_blocks
[
i
]
=
NULL
;
}
else
...
...
@@ -659,8 +659,8 @@ static void chm_set_param(struct chmFile *h,
}
}
free
(
h
->
cache_blocks
);
free
(
h
->
cache_block_indices
);
HeapFree
(
GetProcessHeap
(),
0
,
h
->
cache_blocks
);
HeapFree
(
GetProcessHeap
(),
0
,
h
->
cache_block_indices
);
}
/* now, set new values */
...
...
@@ -692,7 +692,7 @@ struct chmFile *chm_openW(const WCHAR *filename)
struct
chmLzxcControlData
ctlData
;
/* allocate handle */
newHandle
=
malloc
(
sizeof
(
struct
chmFile
));
newHandle
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
chmFile
));
newHandle
->
fd
=
CHM_NULL_FD
;
newHandle
->
lzx_state
=
NULL
;
newHandle
->
cache_blocks
=
NULL
;
...
...
@@ -708,7 +708,7 @@ struct chmFile *chm_openW(const WCHAR *filename)
FILE_ATTRIBUTE_NORMAL
,
NULL
))
==
CHM_NULL_FD
)
{
free
(
newHandle
);
HeapFree
(
GetProcessHeap
(),
0
,
newHandle
);
return
NULL
;
}
...
...
@@ -855,16 +855,16 @@ void chm_close(struct chmFile *h)
for
(
i
=
0
;
i
<
h
->
cache_num_blocks
;
i
++
)
{
if
(
h
->
cache_blocks
[
i
])
free
(
h
->
cache_blocks
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
h
->
cache_blocks
[
i
]);
}
free
(
h
->
cache_blocks
);
HeapFree
(
GetProcessHeap
(),
0
,
h
->
cache_blocks
);
h
->
cache_blocks
=
NULL
;
}
free
(
h
->
cache_block_indices
);
HeapFree
(
GetProcessHeap
(),
0
,
h
->
cache_block_indices
);
h
->
cache_block_indices
=
NULL
;
free
(
h
);
HeapFree
(
GetProcessHeap
(),
0
,
h
);
}
}
...
...
@@ -1193,7 +1193,9 @@ static Int64 _chm_decompress_block(struct chmFile *h,
indexSlot
=
(
int
)((
curBlockIdx
)
%
h
->
cache_num_blocks
);
h
->
cache_block_indices
[
indexSlot
]
=
curBlockIdx
;
if
(
!
h
->
cache_blocks
[
indexSlot
])
h
->
cache_blocks
[
indexSlot
]
=
malloc
(
(
unsigned
int
)(
h
->
reset_table
.
block_len
));
h
->
cache_blocks
[
indexSlot
]
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
unsigned
int
)(
h
->
reset_table
.
block_len
));
lbuffer
=
h
->
cache_blocks
[
indexSlot
];
/* decompress the previous block */
...
...
@@ -1231,7 +1233,8 @@ static Int64 _chm_decompress_block(struct chmFile *h,
indexSlot
=
(
int
)(
block
%
h
->
cache_num_blocks
);
h
->
cache_block_indices
[
indexSlot
]
=
block
;
if
(
!
h
->
cache_blocks
[
indexSlot
])
h
->
cache_blocks
[
indexSlot
]
=
malloc
(
((
unsigned
int
)
h
->
reset_table
.
block_len
));
h
->
cache_blocks
[
indexSlot
]
=
HeapAlloc
(
GetProcessHeap
(),
0
,
((
unsigned
int
)
h
->
reset_table
.
block_len
));
lbuffer
=
h
->
cache_blocks
[
indexSlot
];
*
ubuffer
=
lbuffer
;
...
...
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