summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-01-06 23:15:43 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-01-06 23:15:43 +0100
commit95abb5c2258c7ed3259104a7e5adbc19a1bcd270 (patch)
treedd8e6294cb599a3329f552f79923c75ce2e62e5d
parent0409192b1fde6b7a4f09667e80ca5dc555eab3f1 (diff)
downloadcurl-bagder/multi-app.tar.gz
examples/multi-app.c: call curl_multi_remove_handle as wellbagder/multi-app
Fixes #8234 Reported-by: Melroy van den Berg
-rw-r--r--docs/examples/multi-app.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c
index 58ad03f81..c4619bfbb 100644
--- a/docs/examples/multi-app.c
+++ b/docs/examples/multi-app.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -104,11 +104,13 @@ int main(void)
}
}
- curl_multi_cleanup(multi_handle);
-
- /* Free the CURL handles */
- for(i = 0; i<HANDLECOUNT; i++)
+ /* remove the transfers and cleanup the handles */
+ for(i = 0; i<HANDLECOUNT; i++) {
+ curl_multi_remove_handle(multi_handle, handles[i]);
curl_easy_cleanup(handles[i]);
+ }
+
+ curl_multi_cleanup(multi_handle);
return 0;
}