curl/m4
Viktor Szakats 08c7c937dc
tidy-up: prefer return over exit(), fix fallouts
To avoid breaking the control flow and align to majority of code
already using `return`.

`exit()` has the side-effect of suppressing leak detection in cases.
Fix fallouts detected after switching to `return`.

- configure:
  - fix `getaddrinfo` run test to call `freeaddrinfo()` to pacify ASAN,
    and call `WSACleanup()` to deinit winsock2.
  - fix `getifaddrs` run test to call `freeifaddrs()` to pacify ASAN.
- tests/server:
  - setup `atexit(win32_cleanup)` via `win32_init()`.
  - return 2 instead of 1 on winsock2 init failures.
  - sws: goto cleanup instead of `exit()` in `http_connect()`.
    Follow-up to 02dfe71937 #7235
- tests/client/http:
  - cleanup memory to pacify ASAN in `h2-upgrade-extreme`,
    `tls-session-reuse`.
- examples:
  - block_ip: fix memory leak reported by CI.
  - http2-upload: avoid handle leaks.

Untouched `exit()` calls, made from callbacks:
- docs/examples: ephiperfifo.c, ghiper.c, hiperfifo.c
- tests/libtest: lib582.c, lib655.c, lib670.c
- tests/server: tftpd.c

Closes #16507
2025-02-28 13:11:41 +01:00
..
.gitignore tidy-up: .gitignore lines mostly 2025-01-27 20:59:46 +01:00
curl-amissl.m4 Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
curl-bearssl.m4 build: drop unused feature macros, update exception list 2024-12-16 18:05:24 +01:00
curl-compilers.m4 tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
curl-confopts.m4 build: fix compiler warnings in feature detections 2025-02-16 02:39:35 +01:00
curl-functions.m4 tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
curl-gnutls.m4 build: drop unused feature macros, update exception list 2024-12-16 18:05:24 +01:00
curl-mbedtls.m4 build: drop unused feature macros, update exception list 2024-12-16 18:05:24 +01:00
curl-openssl.m4 build: fix compiler warnings in feature detections 2025-02-16 02:39:35 +01:00
curl-override.m4 build: fix compiler warnings in feature detections 2025-02-16 02:39:35 +01:00
curl-reentrant.m4 lib: use Curl_str_* instead of strtok_r() 2025-02-17 13:18:28 +01:00
curl-rustls.m4 configure: use curl_cv_apple variable 2025-02-16 02:03:16 +01:00
curl-schannel.m4 build: drop unused feature macros, update exception list 2024-12-16 18:05:24 +01:00
curl-sectransp.m4 build: drop unused feature macros, update exception list 2024-12-16 18:05:24 +01:00
curl-sysconfig.m4 configure: use curl_cv_apple variable 2025-02-16 02:03:16 +01:00
curl-wolfssl.m4 build: drop unused feature macros, update exception list 2024-12-16 18:05:24 +01:00
xc-am-iface.m4 misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
xc-cc-check.m4 misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
xc-lt-iface.m4 misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
xc-val-flgs.m4 configure: fix indentation more 2024-08-26 11:14:01 +02:00
zz40-xc-ovr.m4 misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
zz50-xc-ovr.m4 misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
zz60-xc-ovr.m4 misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00