]> xenbits.xensource.com Git - libvirt.git/commit
phyp: Resolve some file descriptor leaks
authorJohn Ferlan <jferlan@redhat.com>
Thu, 10 Jan 2013 19:21:02 +0000 (14:21 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 11 Jan 2013 00:04:06 +0000 (17:04 -0700)
commitb17409674e38e8a3133e5dfcc4f016cb30cec83d
tree40fee3189bc30135fdbe56ede0e75c744b61b105
parentdaa886b635e4a4f46782c8ac6274de1623e12f67
phyp: Resolve some file descriptor leaks

The phypUUIDTable_Push and phypUUIDTable_Pull leaked their file descriptors
on normal return.  Each function had an unnecessary use of creating a buffer
to print conn->uri->user and needed a bit better flow control. I also noted
that the Read function had a cut-n-paste error from the write function on a
couple of VIR_WARN's.

The openSSHSession leaked the sock on the failure path.  Additionally that
turns into the internal_socket in the phypOpen code.  That was neither saved
nor closed on any path. So I used the connnection_data->sock field to save
the socket for eventual close. Of interest here is that phypExec used the
connection_data->sock field even though it had never been initialized.
src/phyp/phyp_driver.c