← Commit list

9fcc7e4c43

MarkLee131
MarkLee131
2026-03-30
SUCCESS Duration: 245s

Subject

tool: fix two more allocator mismatches

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

.mailmap+1 -0
@@ -121,3 +121,4 @@ Andrew Kirillov <[email protected]>
Stephen Farrell <[email protected]>
Calvin Ruocco <[email protected]>
Hamza Bensliman <[email protected]>
+Kaixuan Li <[email protected]>
src/config2setopts.c+10 -3
@@ -208,13 +208,20 @@ static CURLcode ssh_setopts(struct OperationConfig *config, CURL *curl,
if(!config->insecure_ok) {
char *known = config->knownhosts;
- if(!known)
- known = findfile(".ssh/known_hosts", FALSE);
+ if(!known) {
+ char *found = findfile(".ssh/known_hosts", FALSE);
+ if(found) {
+ known = curlx_strdup(found);
+ curl_free(found);
+ if(!known)
+ return CURLE_OUT_OF_MEMORY;
+ }
+ }
if(known) {
result = my_setopt_str(curl, CURLOPT_SSH_KNOWNHOSTS, known);
if(result) {
config->knownhosts = NULL;
- curl_free(known);
+ curlx_free(known);
return result;
}
/* store it in global to avoid repeated checks */
src/tool_getparam.c+10 -4
@@ -1267,10 +1267,16 @@ static ParameterError parse_ech(struct OperationConfig *config,
curlx_fclose(file);
if(err)
return err;
- config->ech_config = curl_maprintf("ecl:%s", tmpcfg);
- curlx_free(tmpcfg);
- if(!config->ech_config)
- return PARAM_NO_MEM;
+ {
+ char *tmp = curl_maprintf("ecl:%s", tmpcfg);
+ curlx_free(tmpcfg);
+ if(!tmp)
+ return PARAM_NO_MEM;
+ config->ech_config = curlx_strdup(tmp);
+ curl_free(tmp);
+ if(!config->ech_config)
+ return PARAM_NO_MEM;
+ }
} /* file done */
}
else {