mirror of
https://github.com/curl/curl.git
synced 2026-08-25 07:03:31 +03:00
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
This commit is contained in:
parent
2e585f5640
commit
08c7c937dc
22 changed files with 222 additions and 150 deletions
|
|
@ -48,7 +48,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if(argc < 1) {
|
||||
puts("report_openssl_version filename");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
libptr = dlopen(argv[1], 0);
|
||||
|
|
@ -65,7 +65,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if(!ssl_version) {
|
||||
puts("Unable to lookup version of OpenSSL");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
version = ssl_version(SSLEAY_VERSION);
|
||||
|
|
@ -91,9 +91,9 @@ int main(int argc, char **argv)
|
|||
|
||||
status = LIB$SET_SYMBOL(&symbol_dsc, &value_dsc, &table_type);
|
||||
if(!$VMS_STATUS_SUCCESS(status)) {
|
||||
exit(status);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue