instance: fix pidfile and seccomp attributes double free
Commit
a5af33ce9a16 ("instance: strdup string attributes") has
introduced duplication of various string attributes in order to fix
use-after-free, but missed handling of `pidfile` and `seccomp` attribute
cases in instance_config_move() where the new value of `pidfile` or
`seccomp` is being copied/assigned. Source of this values is then
free()d in subsequent call to instance_free() and then again for 2nd
time during the service stop command handling, leading to double free
crash:
#0 unmap_chunk at src/malloc/malloc.c:515
#1 free at src/malloc/malloc.c:526
#2 instance_free (in=0xd5e300) at instance.c:1100
#3 instance_delete (in=0xd5e300) at instance.c:559
#4 instance_stop (in=0xd5e300, halt=true) at instance.c:611
While at it, add missing handling of jail.name and jail.hostname
attributes as well.
Ref: FS#2723
Fixes:
a5af33ce9a16 ("instance: strdup string attributes")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>