1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

smtp: fixed a segfault during test 1320 torture test

Under these circumstances, the connection hasn't been fully established
and smtp_connect hasn't been called, yet smtp_done still calls the state
machine which dereferences the NULL conn pointer in struct pingpong.
This commit is contained in:
Dan Fandrich 2014-07-30 23:18:47 +02:00
parent 01a0168806
commit 2c1db913f7

View File

@ -1642,7 +1642,7 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status,
(void)premature; (void)premature;
if(!smtp) if(!smtp || !pp->conn)
/* When the easy handle is removed from the multi interface while libcurl /* When the easy handle is removed from the multi interface while libcurl
is still trying to resolve the host name, the SMTP struct is not yet is still trying to resolve the host name, the SMTP struct is not yet
initialized. However, the removal action calls Curl_done() which in initialized. However, the removal action calls Curl_done() which in