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
cec5601e
Commit
cec5601e
authored
Jan 07, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
charset.c:
memory leak fix I will move my_once_strdup to my_alloc.c later.
parent
00025255
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
mysys/charset.c
mysys/charset.c
+12
-2
No files found.
mysys/charset.c
View file @
cec5601e
...
...
@@ -172,16 +172,26 @@ static void simple_cs_init_functions(CHARSET_INFO *cs)
cs
->
mbmaxlen
=
1
;
}
/* FIXME: BAR: move to more proper place, my_alloc.c I suppose */
static
char
*
my_once_strdup
(
const
char
*
src
,
myf
myflags
)
{
uint
len
=
strlen
(
src
);
char
*
dst
=
my_once_alloc
(
len
+
1
,
myflags
);
if
(
dst
)
memcpy
(
dst
,
src
,
len
+
1
);
return
dst
;
}
static
void
simple_cs_copy_data
(
CHARSET_INFO
*
to
,
CHARSET_INFO
*
from
)
{
to
->
number
=
from
->
number
?
from
->
number
:
to
->
number
;
to
->
state
|=
from
->
state
;
if
(
from
->
csname
)
to
->
csname
=
my_strdup
(
from
->
csname
,
MYF
(
MY_WME
));
to
->
csname
=
my_
once_
strdup
(
from
->
csname
,
MYF
(
MY_WME
));
if
(
from
->
name
)
to
->
name
=
my_strdup
(
from
->
name
,
MYF
(
MY_WME
));
to
->
name
=
my_
once_
strdup
(
from
->
name
,
MYF
(
MY_WME
));
if
(
from
->
ctype
)
{
...
...
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