*: fix places where we were still using malloc/realloc

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-01-08 09:07:50 +01:00
parent ef3817c6dc
commit 9037787eae
5 changed files with 28 additions and 45 deletions

View File

@ -50,9 +50,7 @@ errcode_t ext2fs_resize_mem(unsigned long EXT2FS_ATTR((unused)) old_size,
/* Use "memcpy" for pointer assignments here to avoid problems
* with C99 strict type aliasing rules. */
memcpy(&p, ptr, sizeof (p));
p = realloc(p, size);
if (!p)
return EXT2_ET_NO_MEMORY;
p = xrealloc(p, size);
memcpy(ptr, &p, sizeof (p));
return 0;
}