mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Add test for failing allocation
Avoid memcpy to NULL if realloc fails.
This commit is contained in:
parent
511a5f3ad8
commit
c046a59e7f
@ -1,5 +1,6 @@
|
||||
Version 1.02.70 -
|
||||
===================================
|
||||
Add missing test for failing allocation in dm_realloc() code.
|
||||
Add test for memory allocation failures in regex matcher code.
|
||||
Simplify dm_task_set_geometry() and use dm_asprintf().
|
||||
Set all parameters to 0 for dm_get_next_target() for NULL return.
|
||||
|
@ -192,7 +192,7 @@ void *dm_realloc_aux(void *p, unsigned int s, const char *file, int line)
|
||||
|
||||
r = dm_malloc_aux_debug(s, file, line);
|
||||
|
||||
if (p) {
|
||||
if (r && p) {
|
||||
memcpy(r, p, mb->length);
|
||||
dm_free_aux(p);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user