pmc: Don't leak memory when msg_tlv_append() fails.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>master
parent
51d76bdfb7
commit
86723cfc6a
|
@ -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);
|
extra = msg_tlv_append(msg, sizeof(*mgt) + datasize);
|
||||||
if (!extra) {
|
if (!extra) {
|
||||||
|
msg_put(msg);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
mgt = (struct management_tlv *) extra->tlv;
|
mgt = (struct management_tlv *) extra->tlv;
|
||||||
|
|
Loading…
Reference in New Issue