Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
e8e7fbdb
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e8e7fbdb
编写于
3月 25, 2002
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix memory leak
Submitted by: Nils Larsch
上级
d5c21afd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
0 deletion
+25
-0
crypto/engine/enginetest.c
crypto/engine/enginetest.c
+25
-0
未找到文件。
crypto/engine/enginetest.c
浏览文件 @
e8e7fbdb
...
@@ -79,6 +79,9 @@ static void display_engine_list()
...
@@ -79,6 +79,9 @@ static void display_engine_list()
h
=
ENGINE_get_next
(
h
);
h
=
ENGINE_get_next
(
h
);
}
}
printf
(
"end of list
\n
"
);
printf
(
"end of list
\n
"
);
/* ENGINE_get_first() increases the struct_ref counter, so we
must call ENGINE_free() to decrease it again */
ENGINE_free
(
h
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
...
@@ -94,6 +97,18 @@ int main(int argc, char *argv[])
...
@@ -94,6 +97,18 @@ int main(int argc, char *argv[])
ENGINE
*
new_h3
=
NULL
;
ENGINE
*
new_h3
=
NULL
;
ENGINE
*
new_h4
=
NULL
;
ENGINE
*
new_h4
=
NULL
;
/* enable memory leak checking unless explicitly disabled */
if
(
!
((
getenv
(
"OPENSSL_DEBUG_MEMORY"
)
!=
NULL
)
&&
(
0
==
strcmp
(
getenv
(
"OPENSSL_DEBUG_MEMORY"
),
"off"
))))
{
CRYPTO_malloc_debug_init
();
CRYPTO_set_mem_debug_options
(
V_CRYPTO_MDEBUG_ALL
);
}
else
{
/* OPENSSL_DEBUG_MEMORY=off */
CRYPTO_set_mem_debug_functions
(
0
,
0
,
0
,
0
,
0
);
}
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_ON
);
ERR_load_crypto_strings
();
ERR_load_crypto_strings
();
memset
(
block
,
0
,
512
*
sizeof
(
ENGINE
*
));
memset
(
block
,
0
,
512
*
sizeof
(
ENGINE
*
));
...
@@ -127,6 +142,8 @@ int main(int argc, char *argv[])
...
@@ -127,6 +142,8 @@ int main(int argc, char *argv[])
printf
(
"Remove failed!
\n
"
);
printf
(
"Remove failed!
\n
"
);
goto
end
;
goto
end
;
}
}
if
(
ptr
)
ENGINE_free
(
ptr
);
display_engine_list
();
display_engine_list
();
if
(
!
ENGINE_add
(
new_h3
)
||
!
ENGINE_add
(
new_h2
))
if
(
!
ENGINE_add
(
new_h3
)
||
!
ENGINE_add
(
new_h2
))
{
{
...
@@ -181,6 +198,8 @@ int main(int argc, char *argv[])
...
@@ -181,6 +198,8 @@ int main(int argc, char *argv[])
if
(
!
ENGINE_remove
(
ptr
))
if
(
!
ENGINE_remove
(
ptr
))
printf
(
"Remove failed!i - probably no hardware "
printf
(
"Remove failed!i - probably no hardware "
"support present.
\n
"
);
"support present.
\n
"
);
if
(
ptr
)
ENGINE_free
(
ptr
);
display_engine_list
();
display_engine_list
();
if
(
!
ENGINE_add
(
new_h1
)
||
!
ENGINE_remove
(
new_h1
))
if
(
!
ENGINE_add
(
new_h1
)
||
!
ENGINE_remove
(
new_h1
))
{
{
...
@@ -226,6 +245,7 @@ cleanup_loop:
...
@@ -226,6 +245,7 @@ cleanup_loop:
printf
(
"
\n
Remove failed!
\n
"
);
printf
(
"
\n
Remove failed!
\n
"
);
goto
end
;
goto
end
;
}
}
ENGINE_free
(
ptr
);
printf
(
"."
);
fflush
(
stdout
);
printf
(
"."
);
fflush
(
stdout
);
}
}
for
(
loop
=
0
;
loop
<
512
;
loop
++
)
for
(
loop
=
0
;
loop
<
512
;
loop
++
)
...
@@ -245,5 +265,10 @@ end:
...
@@ -245,5 +265,10 @@ end:
for
(
loop
=
0
;
loop
<
512
;
loop
++
)
for
(
loop
=
0
;
loop
<
512
;
loop
++
)
if
(
block
[
loop
])
if
(
block
[
loop
])
ENGINE_free
(
block
[
loop
]);
ENGINE_free
(
block
[
loop
]);
ENGINE_cleanup
();
CRYPTO_cleanup_all_ex_data
();
ERR_free_strings
();
ERR_remove_state
(
0
);
CRYPTO_mem_leaks_fp
(
stderr
);
return
to_return
;
return
to_return
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录