mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dmeventd: check for malloc return
This commit is contained in:
parent
09a62cca0c
commit
ab6d16a8a5
@ -1394,10 +1394,13 @@ static int _client_read(struct dm_event_fifos *fifos,
|
||||
bytes += ret > 0 ? ret : 0;
|
||||
if (header && (bytes == 2 * sizeof(uint32_t))) {
|
||||
msg->cmd = ntohl(header[0]);
|
||||
msg->size = ntohl(header[1]);
|
||||
buf = msg->data = dm_malloc(msg->size);
|
||||
size = msg->size;
|
||||
size = msg->size = ntohl(header[1]);
|
||||
bytes = 0;
|
||||
if (!size)
|
||||
break; /* No data -> error */
|
||||
buf = msg->data = dm_malloc(msg->size);
|
||||
if (!buf)
|
||||
break; /* No mem -> error */
|
||||
header = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user