Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sqlite3
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
node-sqlite3
Commits
6f0d04f0
Commit
6f0d04f0
authored
Jul 05, 2010
by
Orlando Vazquez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't free bind_req->pair values if there are none.
parent
9fae3abd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
sqlite.js
sqlite.js
+6
-8
statement.cc
src/statement.cc
+6
-2
No files found.
sqlite.js
View file @
6f0d04f0
...
...
@@ -89,16 +89,14 @@ function _doStep(db, statement, rowCallback) {
}
function
_onPrepare
(
db
,
statement
,
bindings
,
rowCallback
)
{
function
next
()
{
_doStep
(
db
,
statement
,
rowCallback
);
}
if
(
Array
.
isArray
(
bindings
))
{
if
(
bindings
.
length
)
{
_setBindingsByIndex
(
db
,
statement
,
bindings
,
_doStep
,
rowCallback
);
}
else
{
_doStep
(
db
,
statement
,
rowCallback
);
}
statement
.
bindArray
(
bindings
,
next
);
}
else
if
(
typeof
(
bindings
)
!==
'undefined
'
)
{
// TODO index by keys
else
if
(
typeof
(
bindings
)
===
'object
'
)
{
statement
.
bindObject
(
bindings
,
next
);
}
}
...
...
src/statement.cc
View file @
6f0d04f0
...
...
@@ -79,8 +79,11 @@ int Statement::EIO_AfterBindArray(eio_req *req) {
bind_req
->
cb
.
Dispose
();
free
(
bind_req
->
pairs
->
key
);;
free
(
bind_req
->
pairs
->
value
);
if
(
bind_req
->
len
)
{
free
(
bind_req
->
pairs
->
key
);
free
(
bind_req
->
pairs
->
value
);
}
free
(
bind_req
->
pairs
);
free
(
bind_req
);
...
...
@@ -259,6 +262,7 @@ Handle<Value> Statement::BindArray(const Arguments& args) {
// setup value
if
(
val
->
IsInt32
())
{
printf
(
"Binding int
\n
"
);
pairs
->
value_type
=
VALUE_INT
;
int
*
value
=
(
int
*
)
malloc
(
sizeof
(
int
));
*
value
=
val
->
Int32Value
();
...
...
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