tool/var: free memory on OOM

Coverity detected this memory leak in OOM situation

Follow-up to 2e160c9c65

Closes #11575
This commit is contained in:
Daniel Stenberg 2023-08-02 13:20:08 +02:00
parent ddb179586f
commit c17bf311f1
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -154,11 +154,11 @@ static ParameterError varfunc(struct GlobalConfig *global,
}
/* put it in the output */
if(curlx_dyn_add(out, enc)) {
if(curlx_dyn_add(out, enc))
err = PARAM_NO_MEM;
break;
}
curl_free(enc);
if(err)
break;
}
}
else if(FUNCMATCH(f, FUNC_B64, FUNC_B64_LEN)) {