diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-10-25 09:34:16 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-10-25 09:34:16 +0000 |
commit | 9dbc2c827d3620c2e6469c7adc5aa35c79514fa1 (patch) | |
tree | 813eff2baa7a1f94f3ddea5b484d90c58a682b38 | |
parent | 91e27ce755a2dbf8084517fb4ec441a260ffee84 (diff) |
fix the check
-rw-r--r-- | lib/tftp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/tftp.c b/lib/tftp.c index 041a5f340..4e0b6de95 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -612,10 +612,12 @@ static CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done) sessionhandle, deal with it */ Curl_reset_reqproto(conn); - state = conn->data->reqdata.proto.tftp = calloc(sizeof(tftp_state_data_t), - 1); - if(!state) - return CURLE_OUT_OF_MEMORY; + if(!(state = conn->data->reqdata.proto.tftp)) { + state = conn->data->reqdata.proto.tftp = calloc(sizeof(tftp_state_data_t), + 1); + if(!state) + return CURLE_OUT_OF_MEMORY; + } conn->bits.close = FALSE; /* keep it open if possible */ |