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>
pull/77/head
Lukasz Marek 11 years ago committed by Michael Niedermayer
parent 59975de777
commit ca671beead
  1. 9
      libavformat/libssh.c

@ -167,13 +167,18 @@ static av_cold void libssh_stat_file(LIBSSHContext *libssh)
static av_cold int libssh_close(URLContext *h) static av_cold int libssh_close(URLContext *h)
{ {
LIBSSHContext *libssh = h->priv_data; LIBSSHContext *libssh = h->priv_data;
if (libssh->file) if (libssh->file) {
sftp_close(libssh->file); sftp_close(libssh->file);
if (libssh->sftp) libssh->file = NULL;
}
if (libssh->sftp) {
sftp_free(libssh->sftp); sftp_free(libssh->sftp);
libssh->sftp = NULL;
}
if (libssh->session) { if (libssh->session) {
ssh_disconnect(libssh->session); ssh_disconnect(libssh->session);
ssh_free(libssh->session); ssh_free(libssh->session);
libssh->session = NULL;
} }
return 0; return 0;
} }

Loading…
Cancel
Save