avi: Fix potential leak