Like other failure cases in load_devices, we need to free those resources as well. Signed-off-by: Guoqing Jiang <gqjiang@xxxxxxxx> --- Assemble.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assemble.c b/Assemble.c index 23892a3720ac..02641900420c 100644 --- a/Assemble.c +++ b/Assemble.c @@ -594,6 +594,9 @@ static int load_devices(struct devs *devices, char *devmap, if (strcmp(c->update, "ppl") == 0 && ident->bitmap_fd >= 0) { pr_err("PPL is not compatible with bitmap\n"); + close(mdfd); + free(devices); + free(devmap); return -1; } -- 2.13.6