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

memory leak in tool_operate.c #4767

Closed
geeknik opened this issue Dec 29, 2019 · 1 comment · Fixed by sthagen/curl-curl#32
Closed

memory leak in tool_operate.c #4767

geeknik opened this issue Dec 29, 2019 · 1 comment · Fixed by sthagen/curl-curl#32

Comments

@geeknik
Copy link

geeknik commented Dec 29, 2019

I did this

Compiled curl with clang + ASAN.

$ echo "SaE6DQotMGRALQpFCSIiRsXd9dIA5K0tCkYJIiKA9dIA5C0tCkUJIuJ2TYINCgABZAD/TWIA5C0t
CgAAAA==" | base64 -d > test0077.conf
$ ./curl -q -K test0077.conf file:///dev/null
Warning: test0077.conf:1: warning: ')▒TP/1.1covM▒▒tl' is unknown
Warning: test0077.conf:2: warning: '-F▒=(▒-▒----' had unsupported trailing
Warning: garbage

Press enter. Press Ctrl-D.

Warning: test0077.conf:4: warning: 'F▒' uses unquoted white space in the line
Warning: that may cause side-effects!
Warning: test0077.conf:4: warning: 'F▒' is unknown
Warning: You can only select one HTTP request method! You asked for both GET
Warning: (-G, --get) and multipart formpost (-F, --form).

=================================================================
==9804==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 11 byte(s) in 1 object(s) allocated from:
    #0 0x480294 in strdup (/root/curl/build-afl/src/curl+0x480294)
    #1 0x52f87e in single_transfer /root/curl/build-afl/src/../../src/tool_operate.c:706:48
    #2 0x52da28 in transfer_per_config /root/curl/build-afl/src/../../src/tool_operate.c:2331:14
    #3 0x52da28 in create_transfer /root/curl/build-afl/src/../../src/tool_operate.c:2347:14
    #4 0x522452 in serial_transfers /root/curl/build-afl/src/../../src/tool_operate.c:2174:12
    #5 0x522452 in run_all_transfers /root/curl/build-afl/src/../../src/tool_operate.c:2372:16
    #6 0x521e67 in operate /root/curl/build-afl/src/../../src/tool_operate.c:2484:18

SUMMARY: AddressSanitizer: 11 byte(s) leaked in 1 allocation(s).
Aborted

I expected the following

No memory leak.

curl/libcurl version

Git commit 779b415

curl 7.68.0-DEV (x86_64-pc-linux-gnu) libcurl/7.68.0-DEV zlib/1.2.11
Release-Date: [unreleased]
Protocols: dict file ftp gopher http imap pop3 rtsp smtp telnet tftp
Features: AsynchDNS IPv6 Largefile libz UnixSockets

operating system

Ubuntu

@jay jay closed this as completed in 249f7b3 Dec 29, 2019
@jay
Copy link
Member

jay commented Dec 29, 2019

Thanks

@lock lock bot locked as resolved and limited conversation to collaborators Apr 2, 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.

2 participants