mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Add missing test for reallocation error.
This commit is contained in:
parent
0f3ab63a24
commit
58e3ba19a2
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.79 -
|
Version 2.02.79 -
|
||||||
===================================
|
===================================
|
||||||
|
Add missing test for reallocation error in _find_parallel_space().
|
||||||
Add check for unlink error result in remove_lockfile() (dmeventd).
|
Add check for unlink error result in remove_lockfile() (dmeventd).
|
||||||
Use dm_free for dm_malloc-ed areas in _clog_ctr/_clog_dtr (cmirrord).
|
Use dm_free for dm_malloc-ed areas in _clog_ctr/_clog_dtr (cmirrord).
|
||||||
Add checks for allocation errors in config node clonning.
|
Add checks for allocation errors in config node clonning.
|
||||||
|
@ -1302,7 +1302,12 @@ static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
|
|||||||
/* Expand areas array if needed after an area was split. */
|
/* Expand areas array if needed after an area was split. */
|
||||||
if (ix + ix_offset > *areas_size_ptr) {
|
if (ix + ix_offset > *areas_size_ptr) {
|
||||||
*areas_size_ptr *= 2;
|
*areas_size_ptr *= 2;
|
||||||
*areas_ptr = dm_realloc(*areas_ptr, sizeof(**areas_ptr) * (*areas_size_ptr));
|
if (!(*areas_ptr = dm_realloc(*areas_ptr,
|
||||||
|
sizeof(**areas_ptr) *
|
||||||
|
(*areas_size_ptr)))) {
|
||||||
|
log_error("Memory reallocation for parallel areas failed.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(*areas_ptr)[ix + ix_offset - 1].pva = pva;
|
(*areas_ptr)[ix + ix_offset - 1].pva = pva;
|
||||||
(*areas_ptr)[ix + ix_offset - 1].used = required;
|
(*areas_ptr)[ix + ix_offset - 1].used = required;
|
||||||
|
Loading…
Reference in New Issue
Block a user