mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-22 07:06:22 +00:00
iscsiadm: Fix a file descriptor leak in an error path
Detected by Coverity. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
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