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
4108a3a9
Commit
4108a3a9
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 connection.c.
parent
f601c015
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
connection.c
dlls/msado15/connection.c
+14
-14
No files found.
dlls/msado15/connection.c
View file @
4108a3a9
...
...
@@ -29,7 +29,6 @@
#include "msado15_backcompat.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "msado15_private.h"
...
...
@@ -108,10 +107,10 @@ static ULONG WINAPI connection_Release( _Connection *iface )
IUnknown_Release
(
connection
->
cp_connev
.
sinks
[
i
]
);
}
if
(
connection
->
session
)
IUnknown_Release
(
connection
->
session
);
heap_
free
(
connection
->
cp_connev
.
sinks
);
heap_
free
(
connection
->
provider
);
heap_
free
(
connection
->
datasource
);
heap_
free
(
connection
);
free
(
connection
->
cp_connev
.
sinks
);
free
(
connection
->
provider
);
free
(
connection
->
datasource
);
free
(
connection
);
}
return
refs
;
}
...
...
@@ -234,8 +233,8 @@ static HRESULT WINAPI connection_put_ConnectionString( _Connection *iface, BSTR
TRACE
(
"%p, %s
\n
"
,
connection
,
debugstr_w
(
str
&&
!
wcsstr
(
str
,
L"Password"
)
?
L"<hidden>"
:
str
)
);
if
(
str
&&
!
(
source
=
strdupW
(
str
)))
return
E_OUTOFMEMORY
;
heap_
free
(
connection
->
datasource
);
if
(
str
&&
!
(
source
=
wcsdup
(
str
)))
return
E_OUTOFMEMORY
;
free
(
connection
->
datasource
);
connection
->
datasource
=
source
;
return
S_OK
;
}
...
...
@@ -518,8 +517,8 @@ static HRESULT WINAPI connection_put_Provider( _Connection *iface, BSTR str )
if
(
!
str
)
return
MAKE_ADO_HRESULT
(
adErrInvalidArgument
);
if
(
!
(
provider
=
strdupW
(
str
)))
return
E_OUTOFMEMORY
;
heap_
free
(
connection
->
provider
);
if
(
!
(
provider
=
wcsdup
(
str
)))
return
E_OUTOFMEMORY
;
free
(
connection
->
provider
);
connection
->
provider
=
provider
;
return
S_OK
;
}
...
...
@@ -751,15 +750,16 @@ static HRESULT WINAPI connpoint_Advise( IConnectionPoint *iface, IUnknown *unk_s
if
(
i
==
connpoint
->
sinks_size
)
{
new_size
=
connpoint
->
sinks_size
*
2
;
if
(
!
(
tmp
=
heap_realloc_zero
(
connpoint
->
sinks
,
new_size
*
sizeof
(
*
connpoint
->
sinks
)
)))
if
(
!
(
tmp
=
realloc
(
connpoint
->
sinks
,
new_size
*
sizeof
(
*
connpoint
->
sinks
)
)))
return
E_OUTOFMEMORY
;
memset
(
tmp
+
connpoint
->
sinks_size
,
0
,
(
new_size
-
connpoint
->
sinks_size
)
*
sizeof
(
*
connpoint
->
sinks
)
);
connpoint
->
sinks
=
tmp
;
connpoint
->
sinks_size
=
new_size
;
}
}
else
{
if
(
!
(
connpoint
->
sinks
=
heap_alloc_zero
(
sizeof
(
*
connpoint
->
sinks
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
connpoint
->
sinks
=
calloc
(
1
,
sizeof
(
*
connpoint
->
sinks
)
)))
return
E_OUTOFMEMORY
;
connpoint
->
sinks_size
=
1
;
i
=
0
;
}
...
...
@@ -860,7 +860,7 @@ HRESULT Connection_create( void **obj )
{
struct
connection
*
connection
;
if
(
!
(
connection
=
heap_
alloc
(
sizeof
(
*
connection
)
)))
return
E_OUTOFMEMORY
;
if
(
!
(
connection
=
m
alloc
(
sizeof
(
*
connection
)
)))
return
E_OUTOFMEMORY
;
connection
->
Connection_iface
.
lpVtbl
=
&
connection_vtbl
;
connection
->
ISupportErrorInfo_iface
.
lpVtbl
=
&
support_error_vtbl
;
connection
->
IConnectionPointContainer_iface
.
lpVtbl
=
&
connpointcontainer_vtbl
;
...
...
@@ -869,9 +869,9 @@ HRESULT Connection_create( void **obj )
connection
->
state
=
adStateClosed
;
connection
->
timeout
=
30
;
connection
->
datasource
=
NULL
;
if
(
!
(
connection
->
provider
=
strdupW
(
L"MSDASQL"
)))
if
(
!
(
connection
->
provider
=
wcsdup
(
L"MSDASQL"
)))
{
heap_
free
(
connection
);
free
(
connection
);
return
E_OUTOFMEMORY
;
}
connection
->
mode
=
adModeUnknown
;
...
...
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