Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
af63ce9d
Commit
af63ce9d
authored
Mar 31, 2005
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - fix small memory leak
parent
9c914957
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
ndb/include/util/Vector.hpp
ndb/include/util/Vector.hpp
+8
-0
ndb/src/mgmapi/mgmapi.cpp
ndb/src/mgmapi/mgmapi.cpp
+10
-2
No files found.
ndb/include/util/Vector.hpp
View file @
af63ce9d
...
...
@@ -61,6 +61,10 @@ Vector<T>::Vector(int i){
template
<
class
T
>
Vector
<
T
>::~
Vector
(){
delete
[]
m_items
;
// safety for placement new usage
m_items
=
0
;
m_size
=
0
;
m_arraySize
=
0
;
}
template
<
class
T
>
...
...
@@ -174,6 +178,10 @@ MutexVector<T>::MutexVector(int i){
template
<
class
T
>
MutexVector
<
T
>::~
MutexVector
(){
delete
[]
m_items
;
// safety for placement new usage
m_items
=
0
;
m_size
=
0
;
m_arraySize
=
0
;
}
template
<
class
T
>
...
...
ndb/src/mgmapi/mgmapi.cpp
View file @
af63ce9d
...
...
@@ -144,6 +144,7 @@ extern "C"
NdbMgmHandle
ndb_mgm_create_handle
()
{
DBUG_ENTER
(
"ndb_mgm_create_handle"
);
NdbMgmHandle
h
=
(
NdbMgmHandle
)
my_malloc
(
sizeof
(
ndb_mgm_handle
),
MYF
(
MY_WME
));
h
->
connected
=
0
;
...
...
@@ -163,7 +164,8 @@ ndb_mgm_create_handle()
h
->
logfile
=
0
;
#endif
return
h
;
DBUG_PRINT
(
"info"
,
(
"handle=0x%x"
,
(
UintPtr
)
h
));
DBUG_RETURN
(
h
);
}
extern
"C"
...
...
@@ -171,10 +173,13 @@ int
ndb_mgm_set_connectstring
(
NdbMgmHandle
handle
,
const
char
*
mgmsrv
)
{
DBUG_ENTER
(
"ndb_mgm_set_connectstring"
);
DBUG_PRINT
(
"info"
,
(
"handle=0x%x"
,
(
UintPtr
)
handle
));
handle
->
cfg
.
~
LocalConfig
();
new
(
&
(
handle
->
cfg
))
LocalConfig
;
if
(
!
handle
->
cfg
.
init
(
mgmsrv
,
0
)
||
handle
->
cfg
.
ids
.
size
()
==
0
)
{
handle
->
cfg
.
~
LocalConfig
();
new
(
&
(
handle
->
cfg
))
LocalConfig
;
handle
->
cfg
.
init
(
0
,
0
);
/* reset the LocalConfig */
SET_ERROR
(
handle
,
NDB_MGM_ILLEGAL_CONNECT_STRING
,
""
);
...
...
@@ -191,8 +196,10 @@ extern "C"
void
ndb_mgm_destroy_handle
(
NdbMgmHandle
*
handle
)
{
DBUG_ENTER
(
"ndb_mgm_destroy_handle"
);
if
(
!
handle
)
return
;
DBUG_VOID_RETURN
;
DBUG_PRINT
(
"info"
,
(
"handle=0x%x"
,
(
UintPtr
)(
*
handle
)));
/**
* important! only disconnect if connected
* other code relies on this
...
...
@@ -209,6 +216,7 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle)
(
*
handle
)
->
cfg
.
~
LocalConfig
();
my_free
((
char
*
)
*
handle
,
MYF
(
MY_ALLOW_ZERO_PTR
));
*
handle
=
0
;
DBUG_VOID_RETURN
;
}
/*****************************************************************************
...
...
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