]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: 51d: silence a warning about null pointer dereference
authorDragan Dosen <ddosen@haproxy.com>
Wed, 1 Jul 2020 17:58:32 +0000 (19:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 1 Jul 2020 21:27:06 +0000 (23:27 +0200)
This is due to issue #713, that reports null pointer dereference
suspected by coverity.

src/51d.c

index b49695bbc43faf8ed03496a21db26ee49f60f8a6..52887a934016ae965ec46aeaf5fe5cde3df52c61 100644 (file)
--- a/src/51d.c
+++ b/src/51d.c
@@ -239,6 +239,7 @@ static void _51d_set_headers(struct sample *smp, fiftyoneDegreesWorkset *ws)
        // No need to null check as this has already been carried out in the
        // calling method
        htx = smp_prefetch_htx(smp, chn, NULL, 1);
+       ALREADY_CHECKED(htx);
 
        for (i = 0; i < global_51degrees.header_count; i++) {
                name.ptr = (global_51degrees.header_names + i)->area;
@@ -277,6 +278,7 @@ static void _51d_set_device_offsets(struct sample *smp, fiftyoneDegreesDeviceOff
        // No need to null check as this has already been carried out in the
        // calling method
        htx = smp_prefetch_htx(smp, chn, NULL, 1);
+       ALREADY_CHECKED(htx);
 
        for (i = 0; i < global_51degrees.header_count; i++) {
                name.ptr = (global_51degrees.header_names + i)->area;