Skip to content

Commit

Permalink
Fix test failure in 90-test_memleak.t
Browse files Browse the repository at this point in the history
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ý <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #26269)

(cherry picked from commit eeb3266)
  • Loading branch information
bernd-edlinger authored and t8m committed Jan 6, 2025
1 parent 2879d18 commit 6a6c451
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/memleaktest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 6a6c451

Please sign in to comment.