Blob Blame History Raw
From a073b40ea293dec87af5f887bb90744ed244e0c9 Mon Sep 17 00:00:00 2001
From: Jerry Snitselaar <jsnitsel@redhat.com>
Date: Mon, 18 Oct 2021 15:10:00 -0700
Subject: [PATCH 1/3] accel-config: clean up double frees in add_group

free(group) is called after jumping to the err_group label,
so don't call free(group) in paths jumping there.

Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
---
 accfg/lib/libaccfg.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
index f4fc17e5ca93..a13be34a7ef5 100644
--- a/accfg/lib/libaccfg.c
+++ b/accfg/lib/libaccfg.c
@@ -870,13 +870,11 @@ static void *add_group(void *parent, int id, const char *group_base,
 	group_base_string = strdup(group_base);
 	if (!group_base_string) {
 		err(ctx, "conversion of group_base_string failed\n");
-		free(group);
 		close(dfd);
 		goto err_group;
 	}
 	if (sscanf(basename(group_base_string),
 				"group%" SCNu64 ".%" SCNu64, &device_id, &group_id) != 2) {
-		free(group);
 		close(dfd);
 		goto err_group;
 	}
-- 
2.33.0