1
0
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:
Zdenek Kabelac 2015-10-19 10:59:09 +02:00
parent 09a62cca0c
commit ab6d16a8a5

View File

@ -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;
}
}