sm: Fix minor memory leak in --export-p12.