summaryrefslogtreecommitdiff
path: root/libavformat/libssh.c
diff options
context:
space:
mode:
authorLukasz Marek <lukasz.m.luki2@gmail.com>2014-07-07 17:23:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-12 03:01:38 +0200
commitca671beead8c7302e19af64126e6ff9c4d732313 (patch)
treefbc6262c6df5cf26166fa30585a93a4c14237b5d /libavformat/libssh.c
parent59975de77741766df4cc48c66bc151a6c31f9291 (diff)
downloadffmpeg-ca671beead8c7302e19af64126e6ff9c4d732313.tar.gz
lavf/libssh: set freed pointers to NULL
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/libssh.c')
-rw-r--r--libavformat/libssh.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/libssh.c b/libavformat/libssh.c
index 87a2a7f9df..3ec60cb8f4 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;
}