Skip to content

Commit

Permalink
Few missing headers, in the <arpa/inet.h> inclusions ones mainly due …
Browse files Browse the repository at this point in the history
…to the fact APR_HAVE* constants are simply into apr.h in addition a small memory leak fix.
  • Loading branch information
David Carlier authored and Felipe Zimmerle committed Sep 28, 2017
1 parent b878ece commit ca673bf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions apache2/msc_status_engine.c
Expand Up @@ -19,6 +19,9 @@
#ifdef WIN32
#include <winsock2.h>
#include <iphlpapi.h>
#else
#include <sys/ioctl.h>
#include <netdb.h>
#endif

#ifdef DARWIN
Expand Down
1 change: 1 addition & 0 deletions apache2/msc_tree.c
Expand Up @@ -14,6 +14,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <apr.h>
#if APR_HAVE_STDINT_H
#include <stdint.h>
#endif
Expand Down
4 changes: 4 additions & 0 deletions apache2/msc_util.c
Expand Up @@ -22,6 +22,10 @@
#include "msc_release.h"
#include "msc_util.h"

#include <apr.h>
#if APR_HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#include <apr_lib.h>
#include <apr_sha1.h>
#include "modsecurity_config.h"
Expand Down
4 changes: 3 additions & 1 deletion apache2/re.c
Expand Up @@ -401,7 +401,7 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
param = opt;
is_counting = 1;
} else {
param = target;
param = apr_pstrdup(msr->mp, target);
}

opt = strchr(param,':');
Expand All @@ -415,6 +415,8 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
if(apr_table_get(ruleset->engine->variables, name) == NULL) {
if(target_list != NULL)
free(target_list);
if (target != NULL)
free(target);
if(replace != NULL)
free(replace);
if(msr) {
Expand Down
2 changes: 1 addition & 1 deletion standalone/config.c
Expand Up @@ -1104,7 +1104,7 @@ const char *process_command_config(server_rec *s,
incpath = w;

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

/* we allow APR_SUCCESS and APR_EINCOMPLETE */
if (APR_ERELATIVE == status) {
Expand Down

0 comments on commit ca673bf

Please sign in to comment.