1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

libdevmapper-event: fix fifo leak on error path

Coverity: when _init_client() fails, client fifo could have
been already openned and needs to be closed on error path.
This commit is contained in:
Zdenek Kabelac 2015-11-08 17:10:38 +01:00
parent 459b3db61e
commit 8b857bfdc6
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.111 -
====================================
Add missing fifo close when failed to initialize client connection.
Version 1.02.110 - 30th October 2015
====================================

View File

@ -587,8 +587,8 @@ static int _do_event(int cmd, char *dmeventd_path, struct dm_event_daemon_messag
};
if (!_init_client(dmeventd_path, &fifos)) {
stack;
return -ESRCH;
ret = -ESRCH;
goto_out;
}
ret = daemon_talk(&fifos, msg, DM_EVENT_CMD_HELLO, NULL, NULL, 0, 0);
@ -598,7 +598,7 @@ static int _do_event(int cmd, char *dmeventd_path, struct dm_event_daemon_messag
if (!ret)
ret = daemon_talk(&fifos, msg, cmd, dso_name, dev_name, evmask, timeout);
out:
/* what is the opposite of init? */
fini_fifos(&fifos);