mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-21 20:51:27 +00:00
iscsiadm: Fix a resource leak in an error path
Detected by Coverity. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
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