Adding free for unpack value data

Free will be triggered only when memory
is specified to be alloc'd for unpacking.