[plugins] director: fixes access to 'just-freed' memory