From dec6a245a93f940e9cd902103537ff75a028c836 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 28 Feb 2012 11:09:06 +0000 Subject: [PATCH] Check result of export_vg_to_buffer and avoid usage of failed buffer. --- lib/cache/lvmetad.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c index e7bd4b416..695cbed70 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -518,7 +518,11 @@ int lvmetad_pv_found(struct id pvid, struct device *device, const struct format_ * formatted and has no conflicting keys with the rest of the * request. */ - export_vg_to_buffer(vg, &buf); + if (!export_vg_to_buffer(vg, &buf)) { + dm_free(pvmeta); + return_0; + } + reply = daemon_send_simple(_lvmetad, "pv_found", "pvmeta = %b", pvmeta, -- 2.43.5