diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2017-06-26 01:03:12 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2017-06-26 01:05:02 -0400 |
commit | 922f800603b76d3762fb335638de01524b562b60 (patch) | |
tree | 80597d7e4968b938dcd71189aaee6340033f8cb4 | |
parent | bec809cb2ee0136a911c1229d9a6f03c4904ed86 (diff) |
tool_getparam: fix memory leak on test 1147 OOM (torture tests)
Bug: https://github.com/curl/curl/pull/1486#issuecomment-310926872
Reported-by: Dan Fandrich
-rw-r--r-- | src/tool_getparam.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 6cb394139..f64208a2b 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -1626,13 +1626,15 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ else err = add2list(&config->headers, h); if(err) - return err; + break; h = strtok(NULL, "\r\n"); } free(string); } if(!use_stdin) fclose(file); + if(err) + return err; } } else { |