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
4b813d94
Commit
4b813d94
authored
Mar 29, 2007
by
monty@mysql.com/narttu.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed memory leak in mysql_upgrade
parent
b3cb8466
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
client/mysql_upgrade.c
client/mysql_upgrade.c
+17
-8
No files found.
client/mysql_upgrade.c
View file @
4b813d94
...
...
@@ -171,7 +171,7 @@ void set_extra_default(int id, const struct my_option *opt)
}
d
=
(
extra_default_t
*
)
my_malloc
(
sizeof
(
extra_default_t
),
MYF
(
MY_FAE
|
MY_ZEROFILL
));
MYF
(
MY_FAE
|
MY_ZEROFILL
));
d
->
id
=
id
;
d
->
name
=
opt
->
name
;
d
->
n_len
=
strlen
(
opt
->
name
);
...
...
@@ -345,15 +345,17 @@ static int create_defaults_file(const char *path, const char *forced_path)
}
dynstr_set
(
&
buf
,
NULL
);
}
if
(
dynstr_append_mem
(
&
buf
,
"
\n
"
,
1
)
||
dynstr_append_mem
(
&
buf
,
d
->
name
,
d
->
n_len
)
||
(
d
->
v_len
&&
(
dynstr_append_mem
(
&
buf
,
"="
,
1
)
||
dynstr_append_mem
(
&
buf
,
d
->
value
,
d
->
v_len
))))
if
(
dynstr_append_mem
(
&
buf
,
"
\n
"
,
1
)
||
dynstr_append_mem
(
&
buf
,
d
->
name
,
d
->
n_len
)
||
(
d
->
v_len
&&
(
dynstr_append_mem
(
&
buf
,
"="
,
1
)
||
dynstr_append_mem
(
&
buf
,
d
->
value
,
d
->
v_len
))))
{
ret
=
1
;
goto
error
;
}
my_delete
((
gptr
)
d
,
MYF
(
0
));
my_free
((
gptr
)
d
,
MYF
(
0
));
list_pop
(
extra_defaults
);
/* pop off the head */
}
if
(
my_write
(
defaults_file
,
buf
.
str
,
buf
.
length
,
MYF
(
MY_FNABP
|
MY_WME
)))
...
...
@@ -451,10 +453,10 @@ int main(int argc, char **argv)
char
*
forced_extra_defaults
;
char
*
local_defaults_group_suffix
;
const
char
*
script_line
;
char
*
upgrade_defaults_path
;
char
*
upgrade_defaults_path
=
NULL
;
char
*
defaults_to_use
=
NULL
;
int
upgrade_defaults_created
=
0
;
int
no_defaults
;
char
path
[
FN_REFLEN
];
DYNAMIC_STRING
cmdline
;
...
...
@@ -464,6 +466,10 @@ int main(int argc, char **argv)
#endif
/* Check if we are forced to use specific defaults */
no_defaults
=
0
;
if
(
argc
>=
2
&&
!
strcmp
(
argv
[
1
],
"--no-defaults"
))
no_defaults
=
1
;
get_defaults_options
(
argc
,
argv
,
&
forced_defaults_file
,
&
forced_extra_defaults
,
&
local_defaults_group_suffix
);
...
...
@@ -652,7 +658,9 @@ int main(int argc, char **argv)
if
(
defaults_to_use
)
{
dynstr_append
(
&
cmdline
,
" "
);
dynstr_append_os_quoted
(
&
cmdline
,
"--defaults-extra-file="
,
dynstr_append_os_quoted
(
&
cmdline
,
(
no_defaults
?
"--defaults-file="
:
"--defaults-extra-file="
),
defaults_to_use
,
NullS
);
}
dynstr_append
(
&
cmdline
,
" "
);
...
...
@@ -684,6 +692,7 @@ int main(int argc, char **argv)
if
(
upgrade_defaults_created
)
my_delete
(
upgrade_defaults_path
,
MYF
(
0
));
my_free
(
upgrade_defaults_path
,
MYF
(
MY_ALLOW_ZERO_PTR
));
my_end
(
info_flag
?
MY_CHECK_ERROR
|
MY_GIVE_INFO
:
0
);
return
ret
;
}
...
...
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