Skip to content
Snippets Groups Projects
Commit ca671bee authored by Lukasz Marek's avatar Lukasz Marek Committed by Michael Niedermayer
Browse files

lavf/libssh: set freed pointers to NULL

parent 59975de7
No related branches found
No related tags found
No related merge requests found
...@@ -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;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment