aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2017-06-26 01:03:12 -0400
committerJay Satiro <raysatiro@yahoo.com>2017-06-26 01:05:02 -0400
commit922f800603b76d3762fb335638de01524b562b60 (patch)
tree80597d7e4968b938dcd71189aaee6340033f8cb4
parentbec809cb2ee0136a911c1229d9a6f03c4904ed86 (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.c4
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 {