mirror of
https://github.com/curl/curl.git
synced 2026-07-05 15:37:16 +03:00
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:
parent
cd7904f5a9
commit
13032ff75c
7 changed files with 43 additions and 14 deletions
|
|
@ -37,6 +37,7 @@
|
|||
#include "tool_parsecfg.h"
|
||||
#include "tool_main.h"
|
||||
#include "tool_stderr.h"
|
||||
#include "tool_help.h"
|
||||
#include "var.h"
|
||||
|
||||
#include <memdebug.h> /* keep this as LAST include */
|
||||
|
|
@ -2750,13 +2751,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
break;
|
||||
case C_HELP: /* --help */
|
||||
if(toggle) {
|
||||
if(*nextarg) {
|
||||
global->help_category = strdup(nextarg);
|
||||
if(!global->help_category) {
|
||||
err = PARAM_NO_MEM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
tool_help((nextarg && *nextarg) ? nextarg : NULL);
|
||||
err = PARAM_HELP_REQUESTED;
|
||||
}
|
||||
/* we now actually support --no-help too! */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue