[vlc-devel] commit: Added a few malloc/strdup checks in ftp. (Laurent Aimar )
git version control
git at videolan.org
Tue Sep 9 22:34:41 CEST 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Sep 9 22:37:32 2008 +0200| [241da007fd1e25cdfb43db0816ddfa85d482a69a] | committer: Laurent Aimar
Added a few malloc/strdup checks in ftp.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=241da007fd1e25cdfb43db0816ddfa85d482a69a
---
modules/access/ftp.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index 0b2a410..75878f4 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -153,6 +153,8 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
psz = strdup( p_sys->url.psz_username );
else
psz = var_CreateGetString( p_access, "ftp-user" );
+ if( !psz )
+ return -1;
if( ftp_SendCommand( p_access, p_sys, "USER %s", psz ) < 0 ||
ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) < 0 )
@@ -173,6 +175,8 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
psz = strdup( p_sys->url.psz_password );
else
psz = var_CreateGetString( p_access, "ftp-pwd" );
+ if( !psz )
+ return -1;
if( ftp_SendCommand( p_access, p_sys, "PASS %s", psz ) < 0 ||
ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) < 0 )
More information about the vlc-devel
mailing list