curl_url_cleanup(3)

πŸ’… curl_url_cleanup(3) β€” free the URL handle πŸ’–

okay so bestie, welcome to the Library Functions Manual corner where curl_url_cleanup(3) is the main character. it's giving free the URL handle, and honestly? obsessed. πŸŽ€


🌸 NAME 🌸

curl_url_cleanup β€” free the URL handle 🫢

✨ SYNOPSIS ✨

#include <curl/curl.h>

void curl_url_cleanup(CURLU *handle);

that's the whole signature, bestie. the argument is CURLU *handle. that's it. πŸ’…

🧚 DESCRIPTION 🧚

okay so what does it do? it frees all the resources associated with the given CURLU handle. all of them. the handle gets its cleanup moment, periodt. πŸ’–

Passing in a NULL pointer in handle makes this function return immediately with no action. like, it literally just vibes back out β€” no cleanup, no drama. πŸ™ˆ

and listen closely: any use of the handle after this function has been called and has returned is illegal. not "oops bestie" illegal β€” illegal. After cleanup returns, do not touch that handle. πŸ’€

🌈 PROTOCOLS 🌈

This functionality affects all supported protocols. all of them, bestie. no cap. πŸ’…

🧚 EXAMPLE 🧚

here's the little demo, exactly as it should be:

int main(void)
{
  CURLU *url = curl_url();
  curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
  curl_url_cleanup(url);
}

see? it makes a CURLU with curl_url(), sets the URL part with curl_url_set(url, CURLUPART_URL, "https://example.com", 0), then calls curl_url_cleanup(url). clean, cute, iconic. πŸŽ€

πŸ¦‹ AVAILABILITY πŸ¦‹

Added in curl 7.62.0. that's the origin story, bestie. 🫢

πŸ’œ RETURN VALUE πŸ’œ

none. literally none. that's the entire return value section. no cap. πŸ’…

πŸ“ SEE ALSO πŸ“

go give these other pages some love, iykyk:


mwah πŸ’– β€” this page is from libcurl, dated 2026-10-12. curl_url_cleanup(3) out! 🫢

πŸ“¦ where this page comes from