_believe_ I'm still finding these. I have no idea what I was
thinking when I wrote this stuff.
git-svn-id: http://svn.tartarus.org/sgt/putty@1162
cda61777-01e9-0310-a592-
d414129be87e
static int raw_closing(Plug plug, char *error_msg, int error_code,
int calling_back)
{
static int raw_closing(Plug plug, char *error_msg, int error_code,
int calling_back)
{
- sk_close(s);
- s = NULL;
+ if (s) {
+ sk_close(s);
+ s = NULL;
+ }
if (error_msg) {
/* A socket error has occurred. */
connection_fatal(error_msg);
if (error_msg) {
/* A socket error has occurred. */
connection_fatal(error_msg);
static int rlogin_closing(Plug plug, char *error_msg, int error_code,
int calling_back)
{
static int rlogin_closing(Plug plug, char *error_msg, int error_code,
int calling_back)
{
- sk_close(s);
- s = NULL;
+ if (s) {
+ sk_close(s);
+ s = NULL;
+ }
if (error_msg) {
/* A socket error has occurred. */
connection_fatal(error_msg);
if (error_msg) {
/* A socket error has occurred. */
connection_fatal(error_msg);
int calling_back)
{
ssh_state = SSH_STATE_CLOSED;
int calling_back)
{
ssh_state = SSH_STATE_CLOSED;
- sk_close(s);
- s = NULL;
+ if (s) {
+ sk_close(s);
+ s = NULL;
+ }
if (error_msg) {
/* A socket error has occurred. */
connection_fatal(error_msg);
if (error_msg) {
/* A socket error has occurred. */
connection_fatal(error_msg);
static int telnet_closing(Plug plug, char *error_msg, int error_code,
int calling_back)
{
static int telnet_closing(Plug plug, char *error_msg, int error_code,
int calling_back)
{
- sk_close(s);
- s = NULL;
+ if (s) {
+ sk_close(s);
+ s = NULL;
+ }
if (error_msg) {
/* A socket error has occurred. */
connection_fatal(error_msg);
if (error_msg) {
/* A socket error has occurred. */
connection_fatal(error_msg);