Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfd49ca7

Browse files
p0pr0ck5Felipe Zimmerle
authored and
Felipe Zimmerle
committed
Don't leak an fd on fuzzy hash initialization
Since we're re-opening this file with every invocation, let'sclose our sanity check fd.
1 parent6cce8a2 commitfd49ca7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎apache2/re_operators.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3828,6 +3828,7 @@ static int msre_op_fuzzy_hash_init(msre_rule *rule, char **error_msg)
38283828
{
38293829
#ifdefWITH_SSDEEP
38303830
structfuzzy_hash_param_data*param_data;
3831+
FILE*fp;
38313832
char*file;
38323833
intparam_len,threshold;
38333834

@@ -3876,14 +3877,15 @@ static int msre_op_fuzzy_hash_init(msre_rule *rule, char **error_msg)
38763877
}
38773878

38783879
file=resolve_relative_path(rule->ruleset->mp,rule->filename,file);
3879-
3880-
if (!fopen(file,"r"))
3880+
3881+
fp=fopen(file,"r");
3882+
if (!fp)
38813883
{
38823884
*error_msg=apr_psprintf(rule->ruleset->mp,"Not able to open file:" \
38833885
" %s.",file);
38843886
return-1;
38853887
}
3886-
3888+
fclose(fp);
38873889

38883890
param_data->file=file;
38893891
param_data->threshold=threshold;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp