Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
9f29ec47
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
9 个月 前同步成功
通知
8
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9f29ec47
编写于
9月 10, 2001
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix memory leak (I think)
上级
b9a20b50
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
16 deletion
+24
-16
crypto/err/err.c
crypto/err/err.c
+24
-16
未找到文件。
crypto/err/err.c
浏览文件 @
9f29ec47
...
...
@@ -216,13 +216,13 @@ static ERR_STRING_DATA ERR_str_reasons[]=
struct
st_ERR_FNS
{
/* Works on the "error_hash" string table */
LHASH
*
(
*
cb_err_get
)(
void
);
LHASH
*
(
*
cb_err_get
)(
int
create
);
void
(
*
cb_err_del
)(
void
);
ERR_STRING_DATA
*
(
*
cb_err_get_item
)(
const
ERR_STRING_DATA
*
);
ERR_STRING_DATA
*
(
*
cb_err_set_item
)(
ERR_STRING_DATA
*
);
ERR_STRING_DATA
*
(
*
cb_err_del_item
)(
ERR_STRING_DATA
*
);
/* Works on the "thread_hash" error-state table */
LHASH
*
(
*
cb_thread_get
)(
void
);
LHASH
*
(
*
cb_thread_get
)(
int
create
);
ERR_STATE
*
(
*
cb_thread_get_item
)(
const
ERR_STATE
*
);
ERR_STATE
*
(
*
cb_thread_set_item
)(
ERR_STATE
*
);
void
(
*
cb_thread_del_item
)(
const
ERR_STATE
*
);
...
...
@@ -231,12 +231,12 @@ struct st_ERR_FNS
};
/* Predeclarations of the "err_defaults" functions */
static
LHASH
*
int_err_get
(
void
);
static
LHASH
*
int_err_get
(
int
create
);
static
void
int_err_del
(
void
);
static
ERR_STRING_DATA
*
int_err_get_item
(
const
ERR_STRING_DATA
*
);
static
ERR_STRING_DATA
*
int_err_set_item
(
ERR_STRING_DATA
*
);
static
ERR_STRING_DATA
*
int_err_del_item
(
ERR_STRING_DATA
*
);
static
LHASH
*
int_thread_get
(
void
);
static
LHASH
*
int_thread_get
(
int
create
);
static
ERR_STATE
*
int_thread_get_item
(
const
ERR_STATE
*
);
static
ERR_STATE
*
int_thread_set_item
(
ERR_STATE
*
);
static
void
int_thread_del_item
(
const
ERR_STATE
*
);
...
...
@@ -323,13 +323,17 @@ static unsigned long get_error_values(int inc,const char **file,int *line,
/* The internal functions used in the "err_defaults" implementation */
static
LHASH
*
int_err_get
(
void
)
static
LHASH
*
int_err_get
(
int
create
)
{
LHASH
*
ret
=
NULL
;
CRYPTO_w_lock
(
CRYPTO_LOCK_ERR
);
if
(
!
int_error_hash
)
if
(
!
int_error_hash
&&
create
)
{
CRYPTO_push_info
(
"int_err_get (err.c)"
);
int_error_hash
=
lh_new
(
err_hash
,
err_cmp
);
CRYPTO_pop_info
();
}
if
(
int_error_hash
)
ret
=
int_error_hash
;
CRYPTO_w_unlock
(
CRYPTO_LOCK_ERR
);
...
...
@@ -354,7 +358,7 @@ static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *d)
LHASH
*
hash
;
err_fns_check
();
hash
=
ERRFN
(
err_get
)();
hash
=
ERRFN
(
err_get
)(
0
);
if
(
!
hash
)
return
NULL
;
...
...
@@ -371,7 +375,7 @@ static ERR_STRING_DATA *int_err_set_item(ERR_STRING_DATA *d)
LHASH
*
hash
;
err_fns_check
();
hash
=
ERRFN
(
err_get
)();
hash
=
ERRFN
(
err_get
)(
1
);
if
(
!
hash
)
return
NULL
;
...
...
@@ -388,7 +392,7 @@ static ERR_STRING_DATA *int_err_del_item(ERR_STRING_DATA *d)
LHASH
*
hash
;
err_fns_check
();
hash
=
ERRFN
(
err_get
)();
hash
=
ERRFN
(
err_get
)(
0
);
if
(
!
hash
)
return
NULL
;
...
...
@@ -399,13 +403,17 @@ static ERR_STRING_DATA *int_err_del_item(ERR_STRING_DATA *d)
return
p
;
}
static
LHASH
*
int_thread_get
(
void
)
static
LHASH
*
int_thread_get
(
int
create
)
{
LHASH
*
ret
=
NULL
;
CRYPTO_w_lock
(
CRYPTO_LOCK_ERR
);
if
(
!
int_thread_hash
)
if
(
!
int_thread_hash
&&
create
)
{
CRYPTO_push_info
(
"int_thread_get (err.c)"
);
int_thread_hash
=
lh_new
(
pid_hash
,
pid_cmp
);
CRYPTO_pop_info
();
}
if
(
int_thread_hash
)
ret
=
int_thread_hash
;
CRYPTO_w_unlock
(
CRYPTO_LOCK_ERR
);
...
...
@@ -418,7 +426,7 @@ static ERR_STATE *int_thread_get_item(const ERR_STATE *d)
LHASH
*
hash
;
err_fns_check
();
hash
=
ERRFN
(
thread_get
)();
hash
=
ERRFN
(
thread_get
)(
0
);
if
(
!
hash
)
return
NULL
;
...
...
@@ -435,7 +443,7 @@ static ERR_STATE *int_thread_set_item(ERR_STATE *d)
LHASH
*
hash
;
err_fns_check
();
hash
=
ERRFN
(
thread_get
)();
hash
=
ERRFN
(
thread_get
)(
1
);
if
(
!
hash
)
return
NULL
;
...
...
@@ -452,7 +460,7 @@ static void int_thread_del_item(const ERR_STATE *d)
LHASH
*
hash
;
err_fns_check
();
hash
=
ERRFN
(
thread_get
)();
hash
=
ERRFN
(
thread_get
)(
0
);
if
(
!
hash
)
return
;
...
...
@@ -800,13 +808,13 @@ char *ERR_error_string(unsigned long e, char *ret)
LHASH
*
ERR_get_string_table
(
void
)
{
err_fns_check
();
return
ERRFN
(
err_get
)();
return
ERRFN
(
err_get
)(
0
);
}
LHASH
*
ERR_get_err_state_table
(
void
)
{
err_fns_check
();
return
ERRFN
(
thread_get
)();
return
ERRFN
(
thread_get
)(
0
);
}
const
char
*
ERR_lib_error_string
(
unsigned
long
e
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录