ucimap: fix possible use of memory after it is freed