代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libtasn1 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From ea0e4fc2567edfc0d20141025837e2bd9c64c0cb Mon Sep 17 00:00:00 2001
From: opneErler BUildteam <[email protected]>
Date: Fri, 5 Jun 2020 15:46:37 +0800
Subject: [PATCH] fix memleaks in asn1 arrat2tree
---
lib/parser_aux.c | 2 +-
lib/structure.c | 20 +++++++++----
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index d5dbbf8..071f1be 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -767,7 +767,7 @@ _asn1_expand_object_id (list_type **list, asn1_node node)
return ASN1_ELEMENT_NOT_FOUND;
_asn1_set_down (p, p2->right);
- if (p2->down)
+ while (p2->down)
_asn1_delete_structure (*list, &p2->down, 0);
_asn1_delete_node_from_list(*list, p2);
_asn1_remove_node (p2, 0);
diff --git a/lib/structure.c b/lib/structure.c
index 8189c56..6dfba58 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -207,13 +207,13 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions,
if (move == DOWN)
{
- if (p_last && p_last->down)
+ while (p_last && p_last->down)
_asn1_delete_structure (e_list, &p_last->down, 0);
_asn1_set_down (p_last, p);
}
else if (move == RIGHT)
{
- if (p_last && p_last->right)
+ while (p_last && p_last->right)
_asn1_delete_structure (e_list, &p_last->right, 0);
_asn1_set_right (p_last, p);
}
@@ -317,7 +317,7 @@ int
_asn1_delete_structure (list_type *e_list, asn1_node * structure, unsigned int flags)
{
asn1_node p, p2, p3;
-
+ int flag_t = 1;
if (*structure == NULL)
return ASN1_ELEMENT_NOT_FOUND;
@@ -347,7 +347,11 @@ _asn1_delete_structure (list_type *e_list, asn1_node * structure, unsigned int f
{
p3 = _asn1_find_up (p);
if (p3)
+ {
_asn1_set_down (p3, p2);
+ p2 = NULL;
+ flag_t = 0;
+ }
else
{
if (p->right)
@@ -355,15 +359,19 @@ _asn1_delete_structure (list_type *e_list, asn1_node * structure, unsigned int f
}
}
else
- _asn1_set_right (p3, p2);
+ {
+ _asn1_set_right (p3,p2);
+ p2 = NULL;
+ flag_t = 0;
+ }
if (e_list)
_asn1_delete_node_from_list (e_list, p);
_asn1_remove_node (p, flags);
- p = NULL;
+ p = p2;
}
}
}
-
+if (flag_t)
*structure = NULL;
return ASN1_SUCCESS;
}
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。