mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
iscsiadm: Fix a resource leak in an error path
Detected by Coverity. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6389 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -39,8 +39,10 @@ int iscsi_adm_request_listen(void)
|
||||
memcpy((char *) &addr.sun_path + 1, ISCSI_ADM_NAMESPACE,
|
||||
strlen(ISCSI_ADM_NAMESPACE));
|
||||
|
||||
if ((err = bind(fd, (struct sockaddr *) &addr, sizeof(addr))) < 0)
|
||||
if ((err = bind(fd, (struct sockaddr *) &addr, sizeof(addr))) < 0) {
|
||||
close(fd);
|
||||
return err;
|
||||
}
|
||||
|
||||
if ((err = listen(fd, 32)) < 0) {
|
||||
close(fd);
|
||||
|
||||
Reference in New Issue
Block a user