Fix wrong memory management

PLUGIN_VAR_MEMALLOC variable must always allocate new memory.