mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 19:51:27 +00:00
iscsiadm: Fix a file descriptor leak in an error path
Detected by Coverity. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -206,6 +206,7 @@ static int iscsid_connect(void)
|
||||
memcpy((char *) &addr.sun_path + 1, ISCSI_ADM_NAMESPACE, strlen(ISCSI_ADM_NAMESPACE));
|
||||
|
||||
if (connect(fd, (struct sockaddr *) &addr, sizeof(addr))) {
|
||||
close(fd);
|
||||
fd = -errno;
|
||||
fprintf(stderr, "Unable to connect to iscsid: %s\n",
|
||||
strerror(-fd));
|
||||
|
||||
Reference in New Issue
Block a user