qdevice: mv free(str) after port validation
in the previous code of qdevice_net_instance_init_from_cmap:
host_port = strtol(str, &ep, 10);
free(str);
if (host_port <= 0 || host_port > ((uint16_t)~0) || *ep != '\0')
before free, *ep is '\0'. But after free, *ep changed to 'U', so mv
free behind the comparison.
Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
(cherry picked from commit d624ea4149ca3539f8b6b9965c75f6c25596d964)