Don't use memory after it has been freed, pointed out by Troy Gutjahr

This commit is contained in:
James Housley 2007-06-15 01:41:58 +00:00
parent 136b2bfcdc
commit 8223acec0a

View File

@ -1430,11 +1430,11 @@ LIBSSH2_API int libssh2_sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle)
LIBSSH2_FREE(session, handle->u.dir.names_packet);
}
handle->close_state = libssh2_NB_state_idle;
LIBSSH2_FREE(session, handle->handle);
LIBSSH2_FREE(session, handle);
handle->close_state = libssh2_NB_state_idle;
return 0;
}
/* }}} */