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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
625ae718
Commit
625ae718
authored
Jul 08, 2010
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Postfix bug#48321
Fix the memory leak
parent
d9e7c4ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
sql/log_event.cc
sql/log_event.cc
+17
-3
No files found.
sql/log_event.cc
View file @
625ae718
...
...
@@ -2396,6 +2396,8 @@ bool Query_log_event::write(IO_CACHE* file)
Query_log_event
::
Query_log_event
()
:
Log_event
(),
data_buf
(
0
)
{
memset
(
&
user
,
0
,
sizeof
(
user
));
memset
(
&
host
,
0
,
sizeof
(
host
));
}
...
...
@@ -2438,6 +2440,9 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
{
time_t
end_time
;
memset
(
&
user
,
0
,
sizeof
(
user
));
memset
(
&
host
,
0
,
sizeof
(
host
));
error_code
=
errcode
;
time
(
&
end_time
);
...
...
@@ -2783,13 +2788,13 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
CHECK_SPACE
(
pos
,
end
,
1
);
user
.
length
=
*
pos
++
;
CHECK_SPACE
(
pos
,
end
,
user
.
length
);
user
.
str
=
my_strndup
((
const
char
*
)
pos
,
user
.
length
,
MYF
(
0
))
;
user
.
str
=
(
char
*
)
pos
;
pos
+=
user
.
length
;
CHECK_SPACE
(
pos
,
end
,
1
);
host
.
length
=
*
pos
++
;
CHECK_SPACE
(
pos
,
end
,
host
.
length
);
host
.
str
=
my_strndup
((
const
char
*
)
pos
,
host
.
length
,
MYF
(
0
))
;
host
.
str
=
(
char
*
)
pos
;
pos
+=
host
.
length
;
}
default:
...
...
@@ -2805,12 +2810,16 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
time_zone_len
+
1
+
data_len
+
1
+
QUERY_CACHE_FLAGS_SIZE
+
user
.
length
+
1
+
host
.
length
+
1
+
db_len
+
1
,
MYF
(
MY_WME
))))
#else
if
(
!
(
start
=
data_buf
=
(
Log_event
::
Byte
*
)
my_malloc
(
catalog_len
+
1
+
time_zone_len
+
1
+
data_len
+
1
,
data_len
+
1
+
user
.
length
+
1
+
host
.
length
+
1
,
MYF
(
MY_WME
))))
#endif
DBUG_VOID_RETURN
;
...
...
@@ -2833,6 +2842,11 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
if
(
time_zone_len
)
copy_str_and_move
(
&
time_zone_str
,
&
start
,
time_zone_len
);
if
(
user
.
length
>
0
)
copy_str_and_move
((
const
char
**
)
&
(
user
.
str
),
&
start
,
user
.
length
);
if
(
host
.
length
>
0
)
copy_str_and_move
((
const
char
**
)
&
(
host
.
str
),
&
start
,
host
.
length
);
/**
if time_zone_len or catalog_len are 0, then time_zone and catalog
are uninitialized at this point. shouldn't they point to the
...
...
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