multi_cleanup: call DONE on handles that never got that

... fixes a memory leak with at least IMAP when remove_handle is never
called and the transfer is abruptly just abandoned early.

Test 1552 added to verify

Detected by OSS-fuzz
Assisted-by: Max Dymond
Closes #1954
This commit is contained in:
Daniel Stenberg 2017-10-06 01:11:17 +02:00
parent 454dae0092
commit 7f1140c8bf
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 171 additions and 20 deletions

View file

@ -169,7 +169,7 @@ test1520 test1521 \
test1525 test1526 test1527 test1528 test1529 test1530 test1531 test1532 \
test1533 test1534 test1535 test1536 test1537 test1538 \
test1540 \
test1550 test1551 \
test1550 test1551 test1552 \
test1600 test1601 test1602 test1603 test1604 test1605 test1606 \
\
test1700 test1701 test1702 \

52
tests/data/test1552 Normal file
View file

@ -0,0 +1,52 @@
<testcase>
<info>
<keywords>
IMAP
Clear Text
FETCH
</keywords>
</info>
#
# Server-side
<reply>
<data>
From: me@somewhere
To: fake@nowhere
body
--
yours sincerely
</data>
<datacheck>
</datacheck>
<servercmd>
</servercmd>
</reply>
#
# Client-side
<client>
<server>
imap
</server>
<name>
IMAP multi transfer error without curl_multi_remove_handle
</name>
# tool is what to use instead of 'curl'
<tool>
lib1552
</tool>
<command>
'imap://%HOSTIP:%IMAPPORT/1552/;UID=1'
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<protocol>
</protocol>
</verify>
</testcase>