mirror of
https://github.com/curl/curl.git
synced 2025-02-05 14:30:10 +08:00
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:
parent
75b31ce626
commit
bc064a8177
@ -96,7 +96,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
|
|||||||
if(curlrc) {
|
if(curlrc) {
|
||||||
file = fopen(curlrc, FOPEN_READTEXT);
|
file = fopen(curlrc, FOPEN_READTEXT);
|
||||||
if(!file) {
|
if(!file) {
|
||||||
curl_free(curlrc);
|
free(curlrc);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
filename = pathalloc = curlrc;
|
filename = pathalloc = curlrc;
|
||||||
@ -285,7 +285,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
|
|||||||
else
|
else
|
||||||
rc = 1; /* couldn't open the file */
|
rc = 1; /* couldn't open the file */
|
||||||
|
|
||||||
curl_free(pathalloc);
|
free(pathalloc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user