diff --git a/src/runmode-pcap.c b/src/runmode-pcap.c index 96232f39ec..51c3d44b33 100644 --- a/src/runmode-pcap.c +++ b/src/runmode-pcap.c @@ -123,7 +123,7 @@ void *ParsePcapConfig(const char *iface) SCLogDebug("could not get bpf or none specified"); } else { /* TODO free this */ - aconf->bpf_filter = strdup(tmpbpf); + aconf->bpf_filter = SCStrdup(tmpbpf); } } else { SCLogInfo("BPF filter set from command line or via old 'bpf-filter' option."); diff --git a/src/runmode-pfring.c b/src/runmode-pfring.c index f21e7b942a..4d02a3cea3 100644 --- a/src/runmode-pfring.c +++ b/src/runmode-pfring.c @@ -95,7 +95,7 @@ void *OldParsePfringConfig(const char *iface) char *tmpclusterid; #ifdef HAVE_PFRING_CLUSTER_TYPE char *tmpctype = NULL; - char * default_ctype = strdup("cluster_round_robin"); + char * default_ctype = SCStrdup("cluster_round_robin"); #endif if (iface == NULL) { @@ -173,7 +173,7 @@ void *ParsePfringConfig(const char *iface) #ifdef HAVE_PFRING_CLUSTER_TYPE char *tmpctype = NULL; /* TODO free me */ - char * default_ctype = strdup("cluster_round_robin"); + char * default_ctype = SCStrdup("cluster_round_robin"); int getctype = 0; #endif diff --git a/src/source-pcap.c b/src/source-pcap.c index ae90bd88a1..0aba4b58b4 100644 --- a/src/source-pcap.c +++ b/src/source-pcap.c @@ -364,7 +364,7 @@ TmEcode ReceivePcapThreadInit(ThreadVars *tv, void *initdata, void **data) { /* set bpf filter if we have one */ if (pcapconfig->bpf_filter) { - ptv->bpf_filter = strdup(pcapconfig->bpf_filter); + ptv->bpf_filter = SCStrdup(pcapconfig->bpf_filter); if(pcap_compile(ptv->pcap_handle,&ptv->filter,ptv->bpf_filter,1,0) < 0) { SCLogError(SC_ERR_BPF,"bpf compilation error %s",pcap_geterr(ptv->pcap_handle)); SCFree(ptv); @@ -419,7 +419,7 @@ TmEcode ReceivePcapThreadInit(ThreadVars *tv, void *initdata, void **data) { /* set bpf filter if we have one */ if (pcapconfig->bpf_filter) { - ptv->bpf_filter = strdup(pcapconfig->bpf_filter); + ptv->bpf_filter = SCStrdup(pcapconfig->bpf_filter); SCLogInfo("using bpf-filter \"%s\"", ptv->bpf_filter); if(pcap_compile(ptv->pcap_handle,&ptv->filter, ptv->bpf_filter,1,0) < 0) { diff --git a/src/source-pfring.c b/src/source-pfring.c index 5eb26178f4..dfd69b143b 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -283,7 +283,7 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data) { ptv->tv = tv; ptv->threads = 1; - ptv->interface = strdup(pfconf->iface); + ptv->interface = SCStrdup(pfconf->iface); ptv->pd = pfring_open(ptv->interface, LIBPFRING_PROMISC, (uint32_t)default_packet_size, LIBPFRING_REENTRANT); if (ptv->pd == NULL) { @@ -302,7 +302,7 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data) { ptv->cluster_id = pfconf->cluster_id; #ifdef HAVE_PFRING_CLUSTER_TYPE - ptv->ctype = (cluster_type)strdup((char *)pfconf->ctype); + ptv->ctype = (cluster_type)SCStrdup((char *)pfconf->ctype); rc = pfring_set_cluster(ptv->pd, ptv->cluster_id, ptv->ctype); #else rc = pfring_set_cluster(ptv->pd, ptv->cluster_id); diff --git a/src/util-runmodes.c b/src/util-runmodes.c index fef6688560..8ef54c6d06 100644 --- a/src/util-runmodes.c +++ b/src/util-runmodes.c @@ -52,7 +52,7 @@ #include "util-runmodes.h" int RunModeSetLiveCaptureAuto(DetectEngineCtx *de_ctx, - ConfigIfaceParserFunc configparser, char *recv_mod_name, + ConfigIfaceParserFunc ConfigParser, char *recv_mod_name, char *decode_mod_name, char *thread_name, const char *live_dev) { @@ -71,7 +71,7 @@ int RunModeSetLiveCaptureAuto(DetectEngineCtx *de_ctx, } SCLogDebug("live_dev %s", live_dev); - aconf = configparser(live_dev); + aconf = ConfigParser(live_dev); if (aconf == NULL) { printf("Single dev: Failed to allocate config\n"); exit(EXIT_FAILURE); @@ -114,7 +114,7 @@ int RunModeSetLiveCaptureAuto(DetectEngineCtx *de_ctx, } SCLogDebug("live_dev %s", live_dev); - aconf = configparser(live_dev); + aconf = ConfigParser(live_dev); if (aconf == NULL) { printf("Failed to allocate config for %s (%d)\n", live_dev, thread); @@ -375,7 +375,7 @@ int RunModeSetLiveCaptureAuto(DetectEngineCtx *de_ctx, } int RunModeSetLiveCaptureAutoFp(DetectEngineCtx *de_ctx, - ConfigIfaceParserFunc configparser, + ConfigIfaceParserFunc ConfigParser, ConfigIfaceThreadsCountFunc mod_threads_count, char *recv_mod_name, char *decode_mod_name, char *thread_name, @@ -410,7 +410,7 @@ int RunModeSetLiveCaptureAutoFp(DetectEngineCtx *de_ctx, SCLogDebug("live_dev %s", live_dev); - aconf = configparser(live_dev); + aconf = ConfigParser(live_dev); if (aconf == NULL) { printf("Failed to allocate config for %s (%d)\n", live_dev, thread); @@ -470,7 +470,7 @@ int RunModeSetLiveCaptureAutoFp(DetectEngineCtx *de_ctx, } SCLogDebug("live_dev %s", live_dev); - aconf = configparser(live_dev); + aconf = ConfigParser(live_dev); if (aconf == NULL) { printf("Multidev: Failed to allocate config for %s (%d)\n", live_dev, lthread); @@ -568,7 +568,7 @@ int RunModeSetLiveCaptureAutoFp(DetectEngineCtx *de_ctx, } int RunModeSetLiveCaptureSingle(DetectEngineCtx *de_ctx, - ConfigIfaceParserFunc configparser, + ConfigIfaceParserFunc ConfigParser, ConfigIfaceThreadsCountFunc mod_threads_count, char *recv_mod_name, char *decode_mod_name, char *thread_name, @@ -586,10 +586,10 @@ int RunModeSetLiveCaptureSingle(DetectEngineCtx *de_ctx, } if (live_dev != NULL) { - aconf = configparser(live_dev); + aconf = ConfigParser(live_dev); } else { char *live_dev_c = LiveGetDevice(0); - aconf = configparser(live_dev_c); + aconf = ConfigParser(live_dev_c); } threads_count = mod_threads_count(aconf);