mem: fix malloc element resize with padding