Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
a8408070
Commit
a8408070
authored
Jul 13, 2015
by
scoder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #417 from mic-e/fixembedleak
Fixed some memory leaks in Utility/Embed.c
parents
6ae1c55d
388c3e9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
Cython/Utility/Embed.c
Cython/Utility/Embed.c
+11
-1
No files found.
Cython/Utility/Embed.c
View file @
a8408070
...
@@ -111,6 +111,7 @@ __Pyx_char2wchar(char* arg)
...
@@ -111,6 +111,7 @@ __Pyx_char2wchar(char* arg)
unless there is a bug in the C library, or I
unless there is a bug in the C library, or I
misunderstood how mbrtowc works. */
misunderstood how mbrtowc works. */
fprintf
(
stderr
,
"unexpected mbrtowc result -2
\\
n"
);
fprintf
(
stderr
,
"unexpected mbrtowc result -2
\\
n"
);
free
(
res
);
return
NULL
;
return
NULL
;
}
}
if
(
converted
==
(
size_t
)
-
1
)
{
if
(
converted
==
(
size_t
)
-
1
)
{
...
@@ -169,14 +170,23 @@ int
...
@@ -169,14 +170,23 @@ int
char
*
oldloc
;
char
*
oldloc
;
if
(
!
argv_copy
||
!
argv_copy2
)
{
if
(
!
argv_copy
||
!
argv_copy2
)
{
fprintf
(
stderr
,
"out of memory
\\
n"
);
fprintf
(
stderr
,
"out of memory
\\
n"
);
if
(
argv_copy
)
free
(
argv_copy
);
if
(
argv_copy2
)
free
(
argv_copy2
);
return
1
;
return
1
;
}
}
oldloc
=
strdup
(
setlocale
(
LC_ALL
,
NULL
));
oldloc
=
strdup
(
setlocale
(
LC_ALL
,
NULL
));
setlocale
(
LC_ALL
,
""
);
setlocale
(
LC_ALL
,
""
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
argv_copy2
[
i
]
=
argv_copy
[
i
]
=
__Pyx_char2wchar
(
argv
[
i
]);
argv_copy2
[
i
]
=
argv_copy
[
i
]
=
__Pyx_char2wchar
(
argv
[
i
]);
if
(
!
argv_copy
[
i
])
if
(
!
argv_copy
[
i
])
{
setlocale
(
LC_ALL
,
oldloc
);
free
(
oldloc
);
free
(
argv_copy
);
free
(
argv_copy2
);
return
1
;
return
1
;
}
}
}
setlocale
(
LC_ALL
,
oldloc
);
setlocale
(
LC_ALL
,
oldloc
);
free
(
oldloc
);
free
(
oldloc
);
...
...
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