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
This commit is contained in:
Jay Satiro 2017-06-26 01:03:12 -04:00
parent bec809cb2e
commit 922f800603

View File

@ -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 {