Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
3b11acf3
Commit
3b11acf3
authored
Apr 24, 2014
by
deuce
Browse files
Fix memory leak when the UNIX _fullpath() returns NULL.
parent
dff20fb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/xpdev/dirwrap.c
src/xpdev/dirwrap.c
+6
-2
No files found.
src/xpdev/dirwrap.c
View file @
3b11acf3
...
...
@@ -882,16 +882,20 @@ char * DLLCALL _fullpath(char *target, const char *path, size_t size) {
if
(
*
path
!=
'/'
)
{
if
(
*
path
==
'~'
)
{
p
=
getenv
(
"HOME"
);
if
(
p
==
NULL
||
strlen
(
p
)
+
strlen
(
path
)
>=
size
)
if
(
p
==
NULL
||
strlen
(
p
)
+
strlen
(
path
)
>=
size
)
{
free
(
target
);
return
(
NULL
);
}
strcpy
(
target
,
p
);
out
=
strrchr
(
target
,
'\0'
);
path
++
;
}
else
{
p
=
getcwd
(
NULL
,
size
);
if
(
p
==
NULL
||
strlen
(
p
)
+
strlen
(
path
)
>=
size
)
if
(
p
==
NULL
||
strlen
(
p
)
+
strlen
(
path
)
>=
size
)
{
free
(
target
);
return
(
NULL
);
}
strcpy
(
target
,
p
);
free
(
p
);
out
=
strrchr
(
target
,
'\0'
);
...
...
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