]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix test failure in 90-test_memleak.t
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 27 Dec 2024 22:02:47 +0000 (23:02 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 6 Jan 2025 19:46:08 +0000 (20:46 +0100)
recent gcc versions can optimize the memory leak away,
avoid that by declaring the lost variable to be volatile.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26269)

test/memleaktest.c

index 97827b8e9cd3c28ab17acb97007e9f38b05f7ac8..a830d55ee7bbb0e8e8fa950ff3bb225eacc38348 100644 (file)
@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
      */
     int exitcode = EXIT_FAILURE;
 #endif
-    char *lost;
+    char *volatile lost;
 
     lost = OPENSSL_malloc(3);
     if (!TEST_ptr(lost))