xref: /curl/docs/libcurl/curl_url_cleanup.md (revision 3040971d)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: curl_url_cleanup
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_CURLU (3)
9  - curl_url (3)
10  - curl_url_dup (3)
11  - curl_url_get (3)
12  - curl_url_set (3)
13Protocol:
14  - All
15Added-in: 7.62.0
16---
17
18# NAME
19
20curl_url_cleanup - free the URL handle
21
22# SYNOPSIS
23
24~~~c
25#include <curl/curl.h>
26
27void curl_url_cleanup(CURLU *handle);
28~~~
29
30# DESCRIPTION
31
32Frees all the resources associated with the given *CURLU* handle.
33
34Passing in a NULL pointer in *handle* makes this function return
35immediately with no action.
36
37Any use of the **handle** after this function has been called and have
38returned, is illegal.
39
40# %PROTOCOLS%
41
42# EXAMPLE
43
44~~~c
45int main(void)
46{
47  CURLU *url = curl_url();
48  curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
49  curl_url_cleanup(url);
50}
51~~~
52
53# %AVAILABILITY%
54
55# RETURN VALUE
56
57none
58