pmc: Don't leak memory when msg_tlv_append() fails.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2019-03-21 17:12:03 +01:00 committed by Richard Cochran
parent 51d76bdfb7
commit 86723cfc6a
1 changed files with 1 additions and 0 deletions

View File

@ -546,6 +546,7 @@ int pmc_send_set_action(struct pmc *pmc, int id, void *data, int datasize)
}
extra = msg_tlv_append(msg, sizeof(*mgt) + datasize);
if (!extra) {
msg_put(msg);
return -ENOMEM;
}
mgt = (struct management_tlv *) extra->tlv;