Skip to content

Commit ca673bf

Browse files
David CarlierFelipe Zimmerle
David Carlier
authored and
Felipe Zimmerle
committed
Few missing headers, in the <arpa/inet.h> inclusions ones mainly due to the fact APR_HAVE* constants are simply into apr.h in addition a small memory leak fix.
1 parent b878ece commit ca673bf

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

apache2/msc_status_engine.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#ifdef WIN32
2020
#include <winsock2.h>
2121
#include <iphlpapi.h>
22+
#else
23+
#include <sys/ioctl.h>
24+
#include <netdb.h>
2225
#endif
2326

2427
#ifdef DARWIN

apache2/msc_tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <stdio.h>
1616
#include <stdlib.h>
17+
#include <apr.h>
1718
#if APR_HAVE_STDINT_H
1819
#include <stdint.h>
1920
#endif

apache2/msc_util.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include "msc_release.h"
2323
#include "msc_util.h"
2424

25+
#include <apr.h>
26+
#if APR_HAVE_ARPA_INET_H
27+
#include <arpa/inet.h>
28+
#endif
2529
#include <apr_lib.h>
2630
#include <apr_sha1.h>
2731
#include "modsecurity_config.h"

apache2/re.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
401401
param = opt;
402402
is_counting = 1;
403403
} else {
404-
param = target;
404+
param = apr_pstrdup(msr->mp, target);
405405
}
406406

407407
opt = strchr(param,':');
@@ -415,6 +415,8 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
415415
if(apr_table_get(ruleset->engine->variables, name) == NULL) {
416416
if(target_list != NULL)
417417
free(target_list);
418+
if (target != NULL)
419+
free(target);
418420
if(replace != NULL)
419421
free(replace);
420422
if(msr) {

standalone/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ const char *process_command_config(server_rec *s,
11041104
incpath = w;
11051105

11061106
/* locate the start of the directories proper */
1107-
status = apr_filepath_root(&rootpath, &incpath, APR_FILEPATH_TRUENAME | APR_FILEPATH_NATIVE, ptemp);
1107+
status = apr_filepath_root((const char **)&rootpath, (const char **)&incpath, APR_FILEPATH_TRUENAME | APR_FILEPATH_NATIVE, ptemp);
11081108

11091109
/* we allow APR_SUCCESS and APR_EINCOMPLETE */
11101110
if (APR_ERELATIVE == status) {

0 commit comments

Comments
 (0)