Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
bb8d69d9
Commit
bb8d69d9
authored
Nov 16, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msado15: Use standard C functions for memory allocation in stream.c.
parent
4899ff58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
stream.c
dlls/msado15/stream.c
+9
-9
No files found.
dlls/msado15/stream.c
View file @
bb8d69d9
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
#include "msado15_backcompat.h"
#include "msado15_backcompat.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "msado15_private.h"
#include "msado15_private.h"
...
@@ -64,9 +63,9 @@ static ULONG WINAPI stream_Release( _Stream *iface )
...
@@ -64,9 +63,9 @@ static ULONG WINAPI stream_Release( _Stream *iface )
if
(
!
refs
)
if
(
!
refs
)
{
{
TRACE
(
"destroying %p
\n
"
,
stream
);
TRACE
(
"destroying %p
\n
"
,
stream
);
heap_
free
(
stream
->
charset
);
free
(
stream
->
charset
);
heap_
free
(
stream
->
buf
);
free
(
stream
->
buf
);
heap_
free
(
stream
);
free
(
stream
);
}
}
return
refs
;
return
refs
;
}
}
...
@@ -183,7 +182,8 @@ static HRESULT resize_buffer( struct stream *stream, LONG size )
...
@@ -183,7 +182,8 @@ static HRESULT resize_buffer( struct stream *stream, LONG size )
{
{
BYTE
*
tmp
;
BYTE
*
tmp
;
LONG
new_size
=
max
(
size
,
stream
->
allocated
*
2
);
LONG
new_size
=
max
(
size
,
stream
->
allocated
*
2
);
if
(
!
(
tmp
=
heap_realloc_zero
(
stream
->
buf
,
new_size
)))
return
E_OUTOFMEMORY
;
if
(
!
(
tmp
=
realloc
(
stream
->
buf
,
new_size
)))
return
E_OUTOFMEMORY
;
memset
(
tmp
+
stream
->
allocated
,
0
,
new_size
-
stream
->
allocated
);
stream
->
buf
=
tmp
;
stream
->
buf
=
tmp
;
stream
->
allocated
=
new_size
;
stream
->
allocated
=
new_size
;
}
}
...
@@ -289,8 +289,8 @@ static HRESULT WINAPI stream_put_Charset( _Stream *iface, BSTR charset )
...
@@ -289,8 +289,8 @@ static HRESULT WINAPI stream_put_Charset( _Stream *iface, BSTR charset )
TRACE
(
"%p, %s
\n
"
,
stream
,
debugstr_w
(
charset
)
);
TRACE
(
"%p, %s
\n
"
,
stream
,
debugstr_w
(
charset
)
);
if
(
!
(
str
=
strdupW
(
charset
)))
return
E_OUTOFMEMORY
;
if
(
!
(
str
=
wcsdup
(
charset
)))
return
E_OUTOFMEMORY
;
heap_
free
(
stream
->
charset
);
free
(
stream
->
charset
);
stream
->
charset
=
str
;
stream
->
charset
=
str
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -360,7 +360,7 @@ static HRESULT WINAPI stream_Close( _Stream *iface )
...
@@ -360,7 +360,7 @@ static HRESULT WINAPI stream_Close( _Stream *iface )
if
(
stream
->
state
==
adStateClosed
)
return
MAKE_ADO_HRESULT
(
adErrObjectClosed
);
if
(
stream
->
state
==
adStateClosed
)
return
MAKE_ADO_HRESULT
(
adErrObjectClosed
);
heap_
free
(
stream
->
buf
);
free
(
stream
->
buf
);
stream
->
buf
=
NULL
;
stream
->
buf
=
NULL
;
stream
->
size
=
stream
->
allocated
=
stream
->
pos
=
0
;
stream
->
size
=
stream
->
allocated
=
stream
->
pos
=
0
;
...
@@ -539,7 +539,7 @@ HRESULT Stream_create( void **obj )
...
@@ -539,7 +539,7 @@ HRESULT Stream_create( void **obj )
{
{
struct
stream
*
stream
;
struct
stream
*
stream
;
if
(
!
(
stream
=
heap_alloc_zero
(
sizeof
(
*
stream
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
stream
=
calloc
(
1
,
sizeof
(
*
stream
)
)))
return
E_OUTOFMEMORY
;
stream
->
Stream_iface
.
lpVtbl
=
&
stream_vtbl
;
stream
->
Stream_iface
.
lpVtbl
=
&
stream_vtbl
;
stream
->
refs
=
1
;
stream
->
refs
=
1
;
stream
->
type
=
adTypeText
;
stream
->
type
=
adTypeText
;
...
...
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