Commit ca671bee authored by Lukasz Marek's avatar Lukasz Marek Committed by Michael Niedermayer

lavf/libssh: set freed pointers to NULL

Signed-off-by: 's avatarLukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 59975de7
...@@ -167,13 +167,18 @@ static av_cold void libssh_stat_file(LIBSSHContext *libssh) ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment