Skip to content

lib/cf-h1-proxy.c: -Wnull-dereference warnings with gcc 12 / curl 8.7.1 #13237

Description

@vszakats

I did this

Built curl-for-win with gcc + mingw-w64.
Got these warnings:

.../curl/lib/cf-h1-proxy.c:1060:17: warning: null pointer dereference [-Wnull-dereference]
 1060 |   cf->connected = FALSE;
      |                 ^
.../curl/lib/cf-h1-proxy.c:1061:8: warning: null pointer dereference [-Wnull-dereference]
 1061 |   if(cf->ctx) {
      |      ~~^~~~~
In function 'tunnel_free',
    inlined from 'cf_h1_proxy_destroy' at .../curl/lib/cf-h1-proxy.c:1053:3:
.../curl/lib/cf-h1-proxy.c:198:27: warning: null pointer dereference [-Wnull-dereference]
  198 |   struct h1_tunnel_state *ts = cf->ctx;
      |                           ^~

Ref: https://github.com/curl/curl-for-win/actions/runs/8492022102/job/23264582018#step:3:10749

I expected the following

No warnings.

curl/libcurl version

curl 8.7.1

operating system

Windows (seems OS-agnostic)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions