diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2024-12-27 23:02:47 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2025-01-06 20:46:08 +0100 |
commit | eeb3266ebba6d70df31f20e4ebd46065fc917ce5 (patch) | |
tree | e2348e6ed80b75962e6b885708989fe4fdfb7d6e /test/memleaktest.c | |
parent | use-of-uninitialized-value in quic_tserver_test (diff) | |
download | openssl-eeb3266ebba6d70df31f20e4ebd46065fc917ce5.tar.xz openssl-eeb3266ebba6d70df31f20e4ebd46065fc917ce5.zip |
Fix test failure in 90-test_memleak.t
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)
Diffstat (limited to '')
-rw-r--r-- | test/memleaktest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/memleaktest.c b/test/memleaktest.c index 97827b8e9c..a830d55ee7 100644 --- a/test/memleaktest.c +++ b/test/memleaktest.c @@ -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)) |