提交 e335e070 编写于 作者: L LiFeng 提交者: lifeng68

image: fix pull image error

Signed-off-by: NLiFeng <lifeng68@huawei.com>
上级 d8250968
......@@ -828,6 +828,10 @@ int util_string_array_unique(const char **elements, size_t length, char ***uniqu
char **tmp_elements = NULL;
size_t tmp_elements_len = 0;
if (elements == NULL || length == 0) {
return 0;
}
map = map_new(MAP_STR_BOOL, MAP_DEFAULT_CMP_FUNC, MAP_DEFAULT_FREE_FUNC);
if (map == NULL) {
ERROR("Out of memory");
......
......@@ -891,6 +891,7 @@ char *image_store_create(const char *id, const char **names, size_t names_len, c
out:
if (ret != 0) {
free(dst_id);
dst_id = NULL;
free_image_t(image);
image = NULL;
}
......
......@@ -197,7 +197,7 @@ int storage_img_create(const char *id, const char *parent_id, const char *metada
int ret = 0;
char *image_id = NULL;
if (id == NULL || metadata == NULL || opts == NULL) {
if (id == NULL || opts == NULL) {
ERROR("Invalid arguments for image create");
ret = -1;
goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册