[tool_parsecfg]: free tparam if any curlx_dyn operation fails

This commit is contained in:
Max Bossing 2025-08-09 15:27:13 +02:00
parent 4b423d8ef8
commit 83dc9487e2

View file

@ -214,15 +214,18 @@ int parseconfig(const char *filename)
char *tparam = strdup(param + 1);
if(!tparam) {
rc = 1; /* out of memory */
free(tparam);
break;
}
curlx_dyn_reset(&pbuf);
if(curlx_dyn_add(&pbuf, home)) {
rc = 1; /* out of memory */
free(tparam);
break;
}
if(curlx_dyn_add(&pbuf, tparam)) {
rc = 1; /* out of memory */
free(tparam);
break;
}
free(tparam);