]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virNetSocketNewConnectUNIX: Don't unlink(NULL)
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 16 Apr 2015 14:07:15 +0000 (16:07 +0200)
committerCole Robinson <crobinso@redhat.com>
Tue, 28 Apr 2015 15:26:07 +0000 (11:26 -0400)
commit5328780b5f7e63f520c9499c5068b4f0f6a7d234
treeccfed28426b4c160dcbf1608ddf999ed49576925
parentc6e7a9ea64f6db453888d7ceaee72333e2237cac
virNetSocketNewConnectUNIX: Don't unlink(NULL)

There is a possibility that we jump onto error label with @lockpath
still initialized to NULL. Here, the @lockpath should be unlink()-ed,
but passing there a NULL is not a good idea. Don't do that. In fact,
we should call unlink() only if we created the lock file successfully.

Reported-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 1fdac3d99a8147092075593d84350d80f5b9bb45)
src/rpc/virnetsocket.c