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
744e22c7
Commit
744e22c7
authored
Sep 26, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 26, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix various query related memory leaks.
parent
42856709
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
32 deletions
+36
-32
package.c
dlls/msi/package.c
+5
-9
select.c
dlls/msi/select.c
+5
-7
sql.y
dlls/msi/sql.y
+21
-11
update.c
dlls/msi/update.c
+2
-4
where.c
dlls/msi/where.c
+3
-1
No files found.
dlls/msi/package.c
View file @
744e22c7
...
...
@@ -757,19 +757,15 @@ UINT MSI_SetPropertyW( MSIPACKAGE *package, LPCWSTR szName, LPCWSTR szValue)
MSI_RecordSetStringW
(
row
,
2
,
szValue
);
}
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
Query
,
&
view
);
if
(
rc
!
=
ERROR_SUCCESS
)
if
(
rc
=
=
ERROR_SUCCESS
)
{
msiobj_release
(
&
row
->
hdr
);
return
rc
;
}
rc
=
MSI_ViewExecute
(
view
,
row
);
rc
=
MSI_ViewExecute
(
view
,
row
);
MSI_ViewClose
(
view
);
msiobj_release
(
&
view
->
hdr
);
}
msiobj_release
(
&
row
->
hdr
);
MSI_ViewClose
(
view
);
msiobj_release
(
&
view
->
hdr
);
return
rc
;
}
...
...
dlls/msi/select.c
View file @
744e22c7
...
...
@@ -189,6 +189,7 @@ static UINT SELECT_delete( struct tagMSIVIEW *view )
if
(
sv
->
table
)
sv
->
table
->
ops
->
delete
(
sv
->
table
);
sv
->
table
=
NULL
;
msi_free
(
sv
);
...
...
@@ -278,13 +279,10 @@ UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
columns
=
columns
->
next
;
}
if
(
r
!=
ERROR_SUCCESS
)
{
sv
->
view
.
ops
->
delete
(
&
sv
->
view
);
sv
=
NULL
;
}
*
view
=
&
sv
->
view
;
if
(
r
==
ERROR_SUCCESS
)
*
view
=
&
sv
->
view
;
else
msi_free
(
sv
);
return
r
;
}
dlls/msi/sql.y
View file @
744e22c7
...
...
@@ -349,11 +349,15 @@ unorderedsel:
| TK_SELECT TK_DISTINCT selectfrom
{
SQL_input* sql = (SQL_input*) info;
UINT r;
$$ = NULL;
DISTINCT_CreateView( sql->db, &$$, $3 );
if( !$$ )
r = DISTINCT_CreateView( sql->db, &$$, $3 );
if (r != ERROR_SUCCESS)
{
$3->ops->delete($3);
YYABORT;
}
}
;
...
...
@@ -361,15 +365,20 @@ selectfrom:
selcollist from
{
SQL_input* sql = (SQL_input*) info;
UINT r;
$$ = NULL;
if( $1 )
SELECT_CreateView( sql->db, &$$, $2, $1 );
{
r = SELECT_CreateView( sql->db, &$$, $2, $1 );
if (r != ERROR_SUCCESS)
{
$2->ops->delete($2);
YYABORT;
}
}
else
$$ = $2;
if( !$$ )
YYABORT;
}
;
...
...
@@ -394,8 +403,11 @@ from:
$$ = NULL;
r = WHERE_CreateView( sql->db, &$$, $1, $3 );
if( r != ERROR_SUCCESS || !$$ )
if( r != ERROR_SUCCESS )
{
$1->ops->delete( $1 );
YYABORT;
}
}
;
...
...
@@ -641,7 +653,7 @@ int SQL_lex( void *SQL_lval, SQL_input *sql )
if( ! sql->command[sql->n] )
return 0; /* end of input */
TRACE("string : %s\n", debugstr_w(&sql->command[sql->n]));
/* TRACE("string : %s\n", debugstr_w(&sql->command[sql->n])); */
sql->len = sqliteGetToken( &sql->command[sql->n], &token );
if( sql->len==0 )
break;
...
...
@@ -650,7 +662,7 @@ int SQL_lex( void *SQL_lval, SQL_input *sql )
}
while( token == TK_SPACE );
TRACE("token : %d (%s)\n", token, debugstr_wn(&sql->command[sql->n], sql->len));
/* TRACE("token : %d (%s)\n", token, debugstr_wn(&sql->command[sql->n], sql->len)); */
return token;
}
...
...
@@ -800,8 +812,6 @@ UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview,
TRACE("Parse returned %d\n", r);
if( r )
{
if( *sql.view )
(*sql.view)->ops->delete( *sql.view );
*sql.view = NULL;
return ERROR_BAD_QUERY_SYNTAX;
}
...
...
dlls/msi/update.c
View file @
744e22c7
...
...
@@ -209,8 +209,7 @@ UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
r
=
WHERE_CreateView
(
db
,
&
wv
,
tv
,
expr
);
if
(
r
!=
ERROR_SUCCESS
)
{
if
(
sv
)
sv
->
ops
->
delete
(
tv
);
tv
->
ops
->
delete
(
tv
);
return
r
;
}
...
...
@@ -218,8 +217,7 @@ UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
r
=
SELECT_CreateView
(
db
,
&
sv
,
wv
,
columns
);
if
(
r
!=
ERROR_SUCCESS
)
{
if
(
tv
)
tv
->
ops
->
delete
(
sv
);
wv
->
ops
->
delete
(
wv
);
return
r
;
}
...
...
dlls/msi/where.c
View file @
744e22c7
...
...
@@ -242,6 +242,7 @@ static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
msi_free
(
wv
->
reorder
);
wv
->
reorder
=
msi_alloc
(
count
*
sizeof
(
UINT
)
);
if
(
!
wv
->
reorder
)
return
ERROR_FUNCTION_FAILED
;
...
...
@@ -328,6 +329,7 @@ static UINT WHERE_delete( struct tagMSIVIEW *view )
if
(
wv
->
table
)
wv
->
table
->
ops
->
delete
(
wv
->
table
);
wv
->
table
=
0
;
msi_free
(
wv
->
reorder
);
wv
->
reorder
=
NULL
;
...
...
@@ -444,7 +446,7 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
MSIWHEREVIEW
*
wv
=
NULL
;
UINT
count
=
0
,
r
,
valid
=
0
;
TRACE
(
"%p
\n
"
,
wv
);
TRACE
(
"%p
\n
"
,
table
);
r
=
table
->
ops
->
get_dimensions
(
table
,
NULL
,
&
count
);
if
(
r
!=
ERROR_SUCCESS
)
...
...
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