]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: fix compiler warning due to uninitialized variable
authorJay Satiro <raysatiro@yahoo.com>
Tue, 3 Jan 2023 22:15:26 +0000 (17:15 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 3 Jan 2023 22:15:26 +0000 (17:15 -0500)
Prior to this change http2_cfilter_add could return an uninitialized
cfilter pointer in an OOM condition. In this case though, the pointer
is discarded and not dereferenced so there was no risk of a crash.

lib/http2.c

index 943853a77a1e858b5509d8269f1cd34ac1a03930..f9e90862400c558b4e75190c963dd78299cd8f65 100644 (file)
@@ -2247,7 +2247,7 @@ static CURLcode http2_cfilter_add(struct Curl_cfilter **pcf,
                                   struct connectdata *conn,
                                   int sockindex)
 {
-  struct Curl_cfilter *cf;
+  struct Curl_cfilter *cf = NULL;
   struct h2_cf_ctx *ctx;
   CURLcode result = CURLE_OUT_OF_MEMORY;