tool_parsecfg: use correct free() call to free memory

Detected by Coverity. CID 1494642.
Follow-up from 2be1aa619b

Closes #8099
This commit is contained in:
Daniel Stenberg 2021-12-06 08:45:03 +01:00
parent 75b31ce626
commit bc064a8177
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -96,7 +96,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
if(curlrc) {
file = fopen(curlrc, FOPEN_READTEXT);
if(!file) {
curl_free(curlrc);
free(curlrc);
return 1;
}
filename = pathalloc = curlrc;
@ -285,7 +285,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
else
rc = 1; /* couldn't open the file */
curl_free(pathalloc);
free(pathalloc);
return rc;
}