From 975ddeeb65836da31222c8c4da82e408c741a33f Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Mon, 18 Dec 2023 20:59:46 +0800
Subject: [PATCH 181/181] bugfix for resort_image_names

Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
 src/daemon/modules/image/oci/storage/image_store/image_store.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/daemon/modules/image/oci/storage/image_store/image_store.c b/src/daemon/modules/image/oci/storage/image_store/image_store.c
index cd827a2d..41587f6e 100644
--- a/src/daemon/modules/image/oci/storage/image_store/image_store.c
+++ b/src/daemon/modules/image/oci/storage/image_store/image_store.c
@@ -473,6 +473,8 @@ static int resort_image_names(const char **names, size_t names_len, char **first
                 goto out;
             }
         }
+        free(prefix);
+        prefix = NULL;
     }
 
     if (first_name == NULL) {
-- 
2.42.0

