Work around a -Wuse-after-free misdetection in GCC 12 in build_send_check_message_req...
commit890d63b43a6aac9f9f5bd83c01f2423aa661c716
authorPetr Písař <petr.pisar@atlas.cz>
Mon, 31 Jan 2022 08:42:48 +0000 (31 09:42 +0100)
committerPetr Písař <petr.pisar@atlas.cz>
Mon, 31 Jan 2022 08:42:53 +0000 (31 09:42 +0100)
tree6cd7dcc74b3ddd2519da6584a8c162894f1e0217
parent65b784bc14014a5c120e76c73ec5c0362d053510
Work around a -Wuse-after-free misdetection in GCC 12 in build_send_check_message_request()

A similar bogus warning appears in only on s390x and ppc64le (not e.g.
on x86_64):

gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 -DLOCALEDIR=\"/usr/share/locale\" -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -Werror -std=c99 -Wall -c isds.c  -fPIC -DPIC -o .libs/libisds_la-isds.o
isds.c: In function 'build_send_check_message_request.part.0':
isds.c:10288:5: error: pointer 'request_38' used after 'free' [-Werror=use-after-free]
10288 |     xmlFreeNode(request);
      |     ^~~~~~~~~~~~~~~~~~~~
isds.c:10286:5: note: call to 'free' here
10286 |     free(message_id_locale);
      |     ^~~~~~~~~~~~~~~~~~~~~~~

<https://bugzilla.redhat.com/show_bug.cgi?id=2047715>
src/isds.c