Static analysis points out that the memory pointed to by 'cur_sec' may
be leaked. Fix the missed goto error; vs return NULL; exit path for an
error condition here.

Cc: Dan Williams <[email protected]>
Signed-off-by: Vishal Verma <[email protected]>
---
 util/parse-configs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/parse-configs.c b/util/parse-configs.c
index 49ee4e0..1b7ffa6 100644
--- a/util/parse-configs.c
+++ b/util/parse-configs.c
@@ -57,7 +57,7 @@ static const char *search_section_kv(dictionary *d, const 
struct config *c)
                        return NULL;
                if (!c->section || !c->search_key || !c->search_val || 
!c->get_key) {
                        fprintf(stderr, "warning: malformed config query, 
skipping\n");
-                       return NULL;
+                       goto out_sec;
                }
 
                cur = strtok_r(cur_sec, delim, &save);

base-commit: c55b18181281b2fffadb9e0e8955d74b8b719349
-- 
2.33.1


Reply via email to