Skip to content

Instantly share code, notes, and snippets.

@bagder
Created March 7, 2025 08:23
Show Gist options
  • Save bagder/e13823ed43566eefac7088357001c89a to your computer and use it in GitHub Desktop.
Save bagder/e13823ed43566eefac7088357001c89a to your computer and use it in GitHub Desktop.
lame memleak fix
diff --git a/lib/url.c b/lib/url.c
index 3b1ce3568..9f4716ed0 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3337,10 +3337,13 @@ static void reuse_conn(struct Curl_easy *data,
temp->hostname_resolve = NULL;
/* reuse init */
existing->bits.reuse = TRUE; /* yes, we are reusing here */
+ if(temp->handler && temp->handler->disconnect)
+ temp->handler->disconnect(data, temp, TRUE);
+
Curl_conn_free(data, temp);
}
/**
* create_conn() sets up a new connectdata struct, or reuses an already
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment