Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc-2-2
Commits
13d9684a
Commit
13d9684a
authored
Nov 14, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ftp: fix leak
(cherry picked from commit f03324bb7ef555420b6b106a40ca833777072b26)
parent
24cb4c71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
modules/access/ftp.c
modules/access/ftp.c
+9
-10
No files found.
modules/access/ftp.c
View file @
13d9684a
...
...
@@ -309,7 +309,6 @@ static void clearCmdTLS( access_sys_t *p_sys )
static
int
Login
(
vlc_object_t
*
p_access
,
access_sys_t
*
p_sys
)
{
int
i_answer
;
char
*
psz
;
/* *** Open a TCP connection with server *** */
int
fd
=
p_sys
->
cmd
.
fd
=
net_ConnectTCP
(
p_access
,
p_sys
->
url
.
psz_host
,
...
...
@@ -340,13 +339,6 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
msg_Dbg
(
p_access
,
"connection accepted (%d)"
,
i_answer
);
if
(
p_sys
->
url
.
psz_username
&&
*
p_sys
->
url
.
psz_username
)
psz
=
strdup
(
p_sys
->
url
.
psz_username
);
else
psz
=
var_InheritString
(
p_access
,
"ftp-user"
);
if
(
!
psz
)
return
-
1
;
/* Features check first */
if
(
ftp_SendCommand
(
p_access
,
p_sys
,
"FEAT"
)
<
0
||
ftp_RecvAnswer
(
p_access
,
p_sys
,
NULL
,
NULL
,
...
...
@@ -387,7 +379,6 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
i_answer
!=
200
)
{
msg_Err
(
p_access
,
"Can't truncate Protection buffer size for TLS"
);
free
(
psz
);
goto
error
;
}
...
...
@@ -396,12 +387,20 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
i_answer
!=
200
)
{
msg_Err
(
p_access
,
"Can't set Data channel protection"
);
free
(
psz
);
goto
error
;
}
}
/* Send credentials over channel */
char
*
psz
;
if
(
p_sys
->
url
.
psz_username
&&
*
p_sys
->
url
.
psz_username
)
psz
=
strdup
(
p_sys
->
url
.
psz_username
);
else
psz
=
var_InheritString
(
p_access
,
"ftp-user"
);
if
(
!
psz
)
goto
error
;
if
(
ftp_SendCommand
(
p_access
,
p_sys
,
"USER %s"
,
psz
)
<
0
||
ftp_RecvCommand
(
p_access
,
p_sys
,
&
i_answer
,
NULL
)
<
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