Fixed leak in static plugin