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

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
5 files changed