1
0
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:
Zdenek Kabelac 2012-02-10 13:52:05 +00:00
parent 511a5f3ad8
commit c046a59e7f
2 changed files with 2 additions and 1 deletions

View File

@ -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.

View File

@ -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);
}