server: Fix use after free in add_committed_range (scan-build).

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2019-09-11 21:05:06 -06:00 committed by Alexandre Julliard
parent 3b2937f7c7
commit f3c9fdf852
1 changed files with 1 additions and 1 deletions

View File

@ -404,7 +404,7 @@ static void add_committed_range( struct memory_view *view, file_pos_t start, fil
struct range *new_ptr = realloc( committed->ranges, new_size * sizeof(*new_ptr) );
if (!new_ptr) return;
committed->max = new_size;
committed->ranges = new_ptr;
ranges = committed->ranges = new_ptr;
}
memmove( &ranges[i + 1], &ranges[i], (committed->count - i) * sizeof(*ranges) );
ranges[i].start = start;