Avoid possible double free in export.c.