← Commit list

c255d2fdcb

Daniel Stenberg
Daniel Stenberg
2025-11-19
SUCCESS Duration: 143s

Subject

tool_cfgable: free ssl-sessions at exit

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 →

src/tool_cfgable.c+1 -0
@@ -260,6 +260,7 @@ static void free_globalconfig(void)
curlx_fclose(global->trace_stream);
global->trace_stream = NULL;
+ tool_safefree(global->ssl_sessions);
tool_safefree(global->libcurl);
#ifdef _WIN32
free(global->term.buf);
src/tool_cfgable.h+1 -0
@@ -29,6 +29,7 @@
#include "tool_sdecls.h"
#include "tool_urlglob.h"
#include "var.h"
+#include "memdebug.h" /* keep this as LAST include */
/* the type we use for storing a single boolean bit */
#ifndef BIT
src/tool_ssls.c+6 -6
@@ -80,8 +80,8 @@ CURLcode tool_ssls_load(struct OperationConfig *config,
i = imported = 0;
while(my_get_line(fp, &buf, &error)) {
++i;
- curl_free(shmac);
- curl_free(sdata);
+ tool_safefree(shmac);
+ tool_safefree(sdata);
line = curlx_dyn_ptr(&buf);
c = memchr(line, ':', strlen(line));
@@ -125,8 +125,8 @@ out:
if(fp)
curlx_fclose(fp);
curlx_dyn_free(&buf);
- curl_free(shmac);
- curl_free(sdata);
+ free(shmac);
+ free(sdata);
return r;
}
@@ -165,7 +165,7 @@ static CURLcode tool_ssls_exp(CURL *easy, void *userptr,
goto out;
if(EOF == fputc(':', ctx->fp))
goto out;
- curl_free(enc);
+ tool_safefree(enc);
r = curlx_base64_encode((const char *)sdata, sdata_len, &enc, &enc_len);
if(r)
goto out;
@@ -179,7 +179,7 @@ static CURLcode tool_ssls_exp(CURL *easy, void *userptr,
out:
if(r)
warnf("Warning: error saving SSL session for '%s': %d", session_key, r);
- curl_free(enc);
+ free(enc);
return r;
}