From 5cf0a6789da260518ed025d41d7dd6a7069fbfcd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 13 Oct 2025 16:08:42 +0200 Subject: [PATCH] examples: call `curl_global_cleanup()` where missing Reported-by: Joshua Rogers (for `sepheaders.c`) Closes #19051 --- docs/examples/multi-uv.c | 2 ++ docs/examples/persistent.c | 2 ++ docs/examples/postit2-formadd.c | 3 +++ docs/examples/postit2.c | 3 +++ docs/examples/sepheaders.c | 2 ++ docs/examples/smooth-gtk-thread.c | 2 ++ docs/examples/synctime.c | 3 +++ docs/examples/threaded-ssl.c | 2 ++ 8 files changed, 19 insertions(+) diff --git a/docs/examples/multi-uv.c b/docs/examples/multi-uv.c index 8cebcd5e26..cc27668d57 100644 --- a/docs/examples/multi-uv.c +++ b/docs/examples/multi-uv.c @@ -252,5 +252,7 @@ int main(int argc, char **argv) uv_run(uv.loop, UV_RUN_DEFAULT); curl_multi_cleanup(uv.multi); + curl_global_cleanup(); + return 0; } diff --git a/docs/examples/persistent.c b/docs/examples/persistent.c index be5e8c33e6..ffcf343fbf 100644 --- a/docs/examples/persistent.c +++ b/docs/examples/persistent.c @@ -66,5 +66,7 @@ int main(void) curl_easy_cleanup(curl); } + curl_global_cleanup(); + return 0; } diff --git a/docs/examples/postit2-formadd.c b/docs/examples/postit2-formadd.c index 0d9034612a..88fb924750 100644 --- a/docs/examples/postit2-formadd.c +++ b/docs/examples/postit2-formadd.c @@ -115,5 +115,8 @@ int main(int argc, char *argv[]) /* free slist */ curl_slist_free_all(headerlist); } + + curl_global_cleanup(); + return 0; } diff --git a/docs/examples/postit2.c b/docs/examples/postit2.c index 0f12cd4786..d16d3fccf6 100644 --- a/docs/examples/postit2.c +++ b/docs/examples/postit2.c @@ -100,5 +100,8 @@ int main(int argc, char *argv[]) /* free slist */ curl_slist_free_all(headerlist); } + + curl_global_cleanup(); + return 0; } diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c index 31a3201241..8f48033a0d 100644 --- a/docs/examples/sepheaders.c +++ b/docs/examples/sepheaders.c @@ -91,5 +91,7 @@ int main(void) /* cleanup curl stuff */ curl_easy_cleanup(curl_handle); + curl_global_cleanup(); + return 0; } diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c index 49a412d958..dc79276ba8 100644 --- a/docs/examples/smooth-gtk-thread.c +++ b/docs/examples/smooth-gtk-thread.c @@ -214,5 +214,7 @@ int main(int argc, char **argv) gdk_threads_leave(); printf("gdk_threads_leave\n"); + curl_global_cleanup(); + return 0; } diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c index 071037a448..d5f5a5bfde 100644 --- a/docs/examples/synctime.c +++ b/docs/examples/synctime.c @@ -360,6 +360,9 @@ int main(int argc, char *argv[]) conf_init(conf); curl_easy_cleanup(curl); } + + curl_global_cleanup(); + return RetValue; } #endif /* CURL_WINDOWS_UWP */ diff --git a/docs/examples/threaded-ssl.c b/docs/examples/threaded-ssl.c index 3868899e4f..98377ee840 100644 --- a/docs/examples/threaded-ssl.c +++ b/docs/examples/threaded-ssl.c @@ -97,5 +97,7 @@ int main(int argc, char **argv) fprintf(stderr, "Thread %d terminated\n", i); } + curl_global_cleanup(); + return 0; }