curl: fix memory leak when -h is used in config file

Reported-by: antypanty on hackerone

Add test 748 to reproduce and verify fix

Closes #17306
This commit is contained in:
Daniel Stenberg 2025-05-09 23:43:22 +02:00
parent cd7904f5a9
commit 13032ff75c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 43 additions and 14 deletions

36
tests/data/test748 Normal file
View file

@ -0,0 +1,36 @@
<testcase>
<info>
<keywords>
--config
</keywords>
</info>
#
# Server-side
<reply>
</reply>
#
# Client-side
<client>
<server>
none
</server>
<name>
A --config file that uses -h and no URL
</name>
<file name="%LOGDIR/cmd">
-h all
</file>
<command>
-K %LOGDIR/cmd
</command>
</client>
<verify>
<errorcode>
2
</errorcode>
</verify>
</testcase>