From e012d0635d34edd98652c9425abb618a9565077a Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 14 Dec 2012 16:45:15 +0100 Subject: [PATCH] lvmetad: check id_read_format error status Detect error from id_read_format() function. --- WHATS_NEW | 1 + lib/cache/lvmetad.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index d535d1030..2fc8acf0e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.99 - =================================== + Check for failing id_read_format() in _pv_populate_lvmcache. Fix memleak on error path for lvmetad's pv_found. Unlock vg mutex in error path when lvmetad tries to lock_vg. Add check for key string duplication in config_make_nodes_v. diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c index 3ce28042b..67e083b3e 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -249,9 +249,10 @@ static struct lvmcache_info *_pv_populate_lvmcache( return NULL; } - if (vgid_txt) - id_read_format(&vgid, vgid_txt); - else + if (vgid_txt) { + if (!id_read_format(&vgid, vgid_txt)) + return_NULL; + } else strcpy((char*)&vgid, fmt->orphan_vg_name); if (!vgname)