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
fe444f02
Commit
fe444f02
authored
Dec 09, 2007
by
Lionel Debroux
Committed by
Alexandre Julliard
Dec 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix memory leaks (found by Smatch).
parent
1bed47a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
database.c
dlls/msi/database.c
+20
-7
No files found.
dlls/msi/database.c
View file @
fe444f02
...
...
@@ -552,7 +552,7 @@ static LPWSTR msi_build_insertsql_columns(LPWSTR *columns_data, LPWSTR *types, D
static
LPWSTR
msi_build_insertsql_data
(
LPWSTR
**
records
,
LPWSTR
*
types
,
DWORD
num_columns
,
DWORD
irec
)
{
LPWSTR
columns
;
LPWSTR
columns
,
temp_columns
;
DWORD
sql_size
=
1
,
i
;
WCHAR
expanded
[
128
];
...
...
@@ -578,6 +578,7 @@ static LPWSTR msi_build_insertsql_data(LPWSTR **records, LPWSTR *types, DWORD nu
lstrcpyW
(
expanded
,
empty
);
break
;
default:
HeapFree
(
GetProcessHeap
(),
0
,
columns
);
return
NULL
;
}
...
...
@@ -585,9 +586,13 @@ static LPWSTR msi_build_insertsql_data(LPWSTR **records, LPWSTR *types, DWORD nu
expanded
[
lstrlenW
(
expanded
)
-
2
]
=
'\0'
;
sql_size
+=
lstrlenW
(
expanded
);
columns
=
msi_realloc
(
columns
,
sql_size
*
sizeof
(
WCHAR
));
if
(
!
columns
)
temp_columns
=
msi_realloc
(
columns
,
sql_size
*
sizeof
(
WCHAR
));
if
(
!
temp_columns
)
{
HeapFree
(
GetProcessHeap
(),
0
,
columns
);
return
NULL
;
}
columns
=
temp_columns
;
lstrcatW
(
columns
,
expanded
);
}
...
...
@@ -654,6 +659,7 @@ UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
LPWSTR
*
columns
,
*
types
,
*
labels
;
LPWSTR
path
,
ptr
,
data
;
LPWSTR
**
records
;
LPWSTR
**
temp_records
;
static
const
WCHAR
backslash
[]
=
{
'\\'
,
0
};
...
...
@@ -680,7 +686,10 @@ UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
records
=
msi_alloc
(
sizeof
(
LPWSTR
*
));
if
(
!
records
)
return
ERROR_OUTOFMEMORY
;
{
r
=
ERROR_OUTOFMEMORY
;
goto
done
;
}
/* read in the table records */
while
(
*
ptr
)
...
...
@@ -688,9 +697,13 @@ UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
msi_parse_line
(
&
ptr
,
&
records
[
num_records
],
NULL
);
num_records
++
;
records
=
msi_realloc
(
records
,
(
num_records
+
1
)
*
sizeof
(
LPWSTR
*
));
if
(
!
records
)
return
ERROR_OUTOFMEMORY
;
temp_records
=
msi_realloc
(
records
,
(
num_records
+
1
)
*
sizeof
(
LPWSTR
*
));
if
(
!
temp_records
)
{
r
=
ERROR_OUTOFMEMORY
;
goto
done
;
}
records
=
temp_records
;
}
r
=
msi_add_table_to_db
(
db
,
columns
,
types
,
labels
,
num_labels
,
num_columns
);
...
...
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