Skip to content

Commit

Permalink
stress-mmaptorture: reduce scope on newptr
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Feb 17, 2025
1 parent 5b63af1 commit 932dd12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stress-mmaptorture.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,11 @@ static int stress_mmaptorture_child(stress_args_t *args, void *context)
defined(MADV_REMOVE)
size_t j;
#endif
uint8_t *newptr;

#if defined(HAVE_MREMAP)
if (mmap_size > page_size) {
uint8_t *newptr;

newptr = (uint8_t *)mremap(ptr, mmap_size, mmap_size - page_size, MREMAP_MAYMOVE);
if (newptr != MAP_FAILED) {
ptr = newptr;
Expand Down

0 comments on commit 932dd12

Please sign in to comment.