[FFmpeg-cvslog] lavf/libssh: set freed pointers to NULL
Lukasz Marek
git at videolan.org
Sat Jul 12 03:06:14 CEST 2014
ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki2 at gmail.com> | Mon Jul 7 17:23:40 2014 +0200| [ca671beead8c7302e19af64126e6ff9c4d732313] | committer: Michael Niedermayer
lavf/libssh: set freed pointers to NULL
Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca671beead8c7302e19af64126e6ff9c4d732313
---
libavformat/libssh.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/libavformat/libssh.c b/libavformat/libssh.c
index 87a2a7f..3ec60cb 100644
--- a/libavformat/libssh.c
+++ b/libavformat/libssh.c
@@ -167,13 +167,18 @@ static av_cold void libssh_stat_file(LIBSSHContext *libssh)
static av_cold int libssh_close(URLContext *h)
{
LIBSSHContext *libssh = h->priv_data;
- if (libssh->file)
+ if (libssh->file) {
sftp_close(libssh->file);
- if (libssh->sftp)
+ libssh->file = NULL;
+ }
+ if (libssh->sftp) {
sftp_free(libssh->sftp);
+ libssh->sftp = NULL;
+ }
if (libssh->session) {
ssh_disconnect(libssh->session);
ssh_free(libssh->session);
+ libssh->session = NULL;
}
return 0;
}
More information about the ffmpeg-cvslog
mailing list