util: Avoid double free in virProcessSetAffinity
util: Avoid double free in virProcessSetAffinity

The cpu mask was free()'d immediately on any error and at the end of the
function, where it was expected that it would either error out and return or
goto another allocation if the code was to fail.  However since commit
9514e24984ee the error path did not return in one new case which caused
double-free in such situation.  In order to make the code more straightforward
just free the mask after it's been used even before checking the return code of
the call.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1819801

Signed-off-by: Martin Kletzander <e82f23e74d43760279ebcc505dac4ae70d5627d0@redhat.com>
Reviewed-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>

nertpinx/libvirt,olafhering/libvirt,crobinso/libvirt,zippy2/libvirt,jfehlig/libvirt,jfehlig/libvirt,zippy2/libvirt,zippy2/libvirt,libvirt/libvirt,jfehlig/libvirt,libvirt/libvirt,olafhering/libvirt,nertpinx/libvirt,zippy2/libvirt,olafhering/libvirt,nertpinx/libvirt,libvirt/libvirt,nertpinx/libvirt,nertpinx/libvirt,olafhering/libvirt,crobinso/libvirt,crobinso/libvirt,crobinso/libvirt,jfehlig/libvirt,libvirt/libvirt