]> git.ipfire.org Git - thirdparty/curl.git/commit
tests/server/sockfilt: check for NULL `tv` to silence clang-tidy
authorViktor Szakats <commit@vsz.me>
Thu, 19 Feb 2026 17:34:35 +0000 (18:34 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 20 Feb 2026 11:08:52 +0000 (12:08 +0100)
commitaa1854a8fffbcd1144b64fc25485ae71a6e6f4cf
tree320c0e4a9059ffbc68a8042468b1bc8b9a1f4e28
parent4042e7d9d8341e059dfe26276797e7296cc66518
tests/server/sockfilt: check for NULL `tv` to silence clang-tidy

A NULL dereference cannot happen with existing use of this code.

linux-mingw, CM clang-tidy:
```
/home/runner/work/curl/curl/tests/server/sockfilt.c:720:24: error: Access
 to field 'tv_sec' results in a dereference of a null pointer (loaded from
 variable 'tv') [clang-analyzer-core.NullDereference,-warnings-as-errors]
  720 |             tv->tv_sec = 0;
      |             ~~         ^
```
Ref: https://github.com/curl/curl/actions/runs/22191200093/job/64179197235?pr=20631#step:10:283

Cherry-picked from #20631

Closes #20639
tests/server/sockfilt.c