]> git.sesse.net Git - ffmpeg/commitdiff
lavf/libssh: set freed pointers to NULL
authorLukasz Marek <lukasz.m.luki2@gmail.com>
Mon, 7 Jul 2014 15:23:40 +0000 (17:23 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 12 Jul 2014 01:01:38 +0000 (03:01 +0200)
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/libssh.c

index 87a2a7f9dfb7f6d3e266dde366c71e160c36cbad..3ec60cb8f4148b0228fece05952733ee59e0947e 100644 (file)
@@ -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;
 }