Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mime.c memory leak #4781

Closed
bagder opened this issue Jan 4, 2020 · 1 comment
Closed

mime.c memory leak #4781

bagder opened this issue Jan 4, 2020 · 1 comment

Comments

@bagder
Copy link
Member

bagder commented Jan 4, 2020

And $ echo "LUY9CnVyIDA=" | base64 -d > test0061.conf && ./curl -q -K test0061.conf file:///dev/null produces this leak in mime.c:

curl: (7) Failed to connect to 0 port 80: Connection refused

=================================================================
==2511==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 448 byte(s) in 1 object(s) allocated from:
    #0 0x49451d in malloc (/root/curl/build2-afl/src/curl+0x49451d)
    #1 0x6c51eb in curl_mime_addpart /root/curl/build2-afl/lib/../../lib/mime.c:1252:28

Indirect leak of 104 byte(s) in 1 object(s) allocated from:
    #0 0x49451d in malloc (/root/curl/build2-afl/src/curl+0x49451d)
    #1 0x6c4e6c in curl_mime_init /root/curl/build2-afl/lib/../../lib/mime.c:1215:24

Indirect leak of 1 byte(s) in 1 object(s) allocated from:
    #0 0x49451d in malloc (/root/curl/build2-afl/src/curl+0x49451d)
    #1 0x6c353b in curl_mime_data /root/curl/build2-afl/lib/../../lib/mime.c:1318:18

SUMMARY: AddressSanitizer: 553 byte(s) leaked in 3 allocation(s).

Originally posted by @geeknik in #4772 (comment)

@bagder
Copy link
Member Author

bagder commented Jan 4, 2020

I can reproduce.

bagder added a commit that referenced this issue Jan 4, 2020
... as it could otherwise leak memory when a transfer failed.

Added test 1293 to verify.

Reported-by: Brian Carpenter
Closes #4781
@bagder bagder closed this as completed in 392bff4 Jan 4, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

1 participant