]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: skip selinux cleanup when fd not available
authorEric Blake <eblake@redhat.com>
Wed, 27 Nov 2013 03:57:05 +0000 (20:57 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 27 Nov 2013 13:08:28 +0000 (06:08 -0700)
commitc8b8b50c3bcf46ebe5f3a152ff681779024a0846
tree728337ea8304b97330e301da153a7227719b4659
parent8e043864ecd32cd402176308d00ced8e8a15f758
storage: skip selinux cleanup when fd not available

When attempting to backport gluster pools to an older versoin
where there is no VIR_STRDUP, I got a crash from calling
strdup(,NULL). Rather than relying on the current else branch
safely doing nothing when there is no fd, it is easier to just
skip it. While at it, there's no need to explicitly set
perms.label to NULL after a VIR_FREE().

* src/storage/storage_backend.c
(virStorageBackendUpdateVolTargetInfoFD): Minor optimization.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/storage/storage_backend.c