mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
lvmetad: fix socket leak in handle_connect
Close socket_fd and report error on malloc failure.
This commit is contained in:
parent
e012d0635d
commit
4008f4f891
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.99 -
|
Version 2.02.99 -
|
||||||
===================================
|
===================================
|
||||||
|
Fix socket leak on error path in lvmetad's handle_connect.
|
||||||
Check for failing id_read_format() in _pv_populate_lvmcache.
|
Check for failing id_read_format() in _pv_populate_lvmcache.
|
||||||
Fix memleak on error path for lvmetad's pv_found.
|
Fix memleak on error path for lvmetad's pv_found.
|
||||||
Unlock vg mutex in error path when lvmetad tries to lock_vg.
|
Unlock vg mutex in error path when lvmetad tries to lock_vg.
|
||||||
|
@ -427,8 +427,12 @@ static int handle_connect(daemon_state s)
|
|||||||
if (client.socket_fd < 0)
|
if (client.socket_fd < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!(baton = malloc(sizeof(struct thread_baton))))
|
if (!(baton = malloc(sizeof(struct thread_baton)))) {
|
||||||
|
if (close(client.socket_fd))
|
||||||
|
perror("close");
|
||||||
|
ERROR(&s, "Failed to allocate thread baton");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
baton->s = s;
|
baton->s = s;
|
||||||
baton->client = client;
|
baton->client = client;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user