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

Commit80a6a38

Browse files
committed
Fix Bug: Memory leak when creating the AGMDB handler
1 parent8631ff1 commit80a6a38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎apache2/persist_dbm.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,9 @@ static int collection_store_ex(int db_option, modsec_rec *msr, apr_table_t *col)
604604
msr_log_error(msr,"[ERROR]collection_retrieve_ex_agmdb: Cannot find root_config in msr->dcfg1.");
605605
gotoerror;
606606
}
607-
new_handle= (structagmdb_handle_entry*)malloc(sizeof(structagmdb_handle_entry));
608-
new_handle->col_name= (char*)malloc(var_name->value_len);
609-
new_handle->handle=malloc(sizeof(structagmdb_handler));
607+
new_handle= (structagmdb_handle_entry*)apr_pcalloc(root_dcfg->mp,sizeof(structagmdb_handle_entry));
608+
new_handle->col_name= (char*)apr_pcalloc(root_dcfg->mp,var_name->value_len);
609+
new_handle->handle=apr_pcalloc(root_dcfg->mp,sizeof(structagmdb_handler));
610610
strcpy((char*)(new_handle->col_name),var_name->value);
611611

612612
rc=AGMDB_openDB(new_handle->handle,new_db_name,strlen(new_db_name),DEFAULT_AGMDB_ENTRY_NUM);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp