This avoids leaving pointers to already freed memory in memory. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>