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
99ad76c3
Commit
99ad76c3
authored
Dec 30, 2007
by
Lionel Debroux
Committed by
Alexandre Julliard
Jan 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Correctly handle return value of msi_realloc.
parent
66dc01be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
action.c
dlls/msi/action.c
+7
-3
database.c
dlls/msi/database.c
+14
-6
No files found.
dlls/msi/action.c
View file @
99ad76c3
...
...
@@ -4482,7 +4482,7 @@ static UINT ACTION_InstallServices( MSIPACKAGE *package )
/* converts arg1[~]arg2[~]arg3 to a list of ptrs to the strings */
static
LPCWSTR
*
msi_service_args_to_vector
(
LPWSTR
args
,
DWORD
*
numargs
)
{
LPCWSTR
*
vector
;
LPCWSTR
*
vector
,
*
temp_vector
;
LPWSTR
p
,
q
;
DWORD
sep_len
;
...
...
@@ -4508,9 +4508,13 @@ static LPCWSTR *msi_service_args_to_vector(LPWSTR args, DWORD *numargs)
{
*
q
=
'\0'
;
vector
=
msi_realloc
(
vector
,
(
*
numargs
+
1
)
*
sizeof
(
LPWSTR
));
if
(
!
vector
)
temp_vector
=
msi_realloc
(
vector
,
(
*
numargs
+
1
)
*
sizeof
(
LPWSTR
));
if
(
!
temp_vector
)
{
msi_free
(
vector
);
return
NULL
;
}
vector
=
temp_vector
;
p
=
q
+
sep_len
;
}
...
...
dlls/msi/database.c
View file @
99ad76c3
...
...
@@ -353,7 +353,7 @@ static LPWSTR msi_build_createsql_prelude(LPWSTR table)
static
LPWSTR
msi_build_createsql_columns
(
LPWSTR
*
columns_data
,
LPWSTR
*
types
,
DWORD
num_columns
)
{
LPWSTR
columns
;
LPWSTR
columns
,
p
;
LPCWSTR
type
;
DWORD
sql_size
=
1
,
i
,
len
;
WCHAR
expanded
[
128
],
*
ptr
;
...
...
@@ -413,9 +413,13 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D
sprintfW
(
expanded
,
column_fmt
,
columns_data
[
i
],
type
,
size
,
extra
,
comma
);
sql_size
+=
lstrlenW
(
expanded
);
columns
=
msi_realloc
(
columns
,
sql_size
*
sizeof
(
WCHAR
));
if
(
!
columns
)
p
=
msi_realloc
(
columns
,
sql_size
*
sizeof
(
WCHAR
));
if
(
!
p
)
{
msi_free
(
columns
);
return
NULL
;
}
columns
=
p
;
lstrcatW
(
columns
,
expanded
);
}
...
...
@@ -519,7 +523,7 @@ static LPWSTR msi_build_insertsql_prelude(LPWSTR table)
static
LPWSTR
msi_build_insertsql_columns
(
LPWSTR
*
columns_data
,
LPWSTR
*
types
,
DWORD
num_columns
)
{
LPWSTR
columns
;
LPWSTR
columns
,
p
;
DWORD
sql_size
=
1
,
i
;
WCHAR
expanded
[
128
];
...
...
@@ -540,9 +544,13 @@ static LPWSTR msi_build_insertsql_columns(LPWSTR *columns_data, LPWSTR *types, D
expanded
[
lstrlenW
(
expanded
)
-
2
]
=
'\0'
;
}
columns
=
msi_realloc
(
columns
,
sql_size
*
sizeof
(
WCHAR
));
if
(
!
columns
)
p
=
msi_realloc
(
columns
,
sql_size
*
sizeof
(
WCHAR
));
if
(
!
p
)
{
msi_free
(
columns
);
return
NULL
;
}
columns
=
p
;
lstrcatW
(
columns
,
expanded
);
}
...
...
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