From cca2a652d1ac2fa67677e3dca50141efa8e2c1a9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 22 Jun 2020 11:07:34 +0200 Subject: [PATCH] cov: avoid double call of free_hints() on error path Since we 'free_hints()' on return error path from call of _read_hint_file(), avoid calling it twice in the middle of error path process. --- lib/label/hints.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/label/hints.c b/lib/label/hints.c index 9546f4880..efa02f7c5 100644 --- a/lib/label/hints.c +++ b/lib/label/hints.c @@ -801,10 +801,8 @@ static int _read_hint_file(struct cmd_context *cmd, struct dm_list *hints, int * if (fclose(fp)) stack; - if (!ret) { - free_hints(hints); + if (!ret) return 0; - } if (!found) return 1; -- 2.43.5