From: Russ Combs (rucombs) Date: Fri, 12 Feb 2016 21:05:27 +0000 (-0500) Subject: Merge pull request #265 in SNORT/snort3 from ~JOCORNET/snort3:memory to master X-Git-Tag: 3.0.0-233~610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd6e31dff6931acdafa6d44b3b8cc3c8a0705b36;p=thirdparty%2Fsnort3.git Merge pull request #265 in SNORT/snort3 from ~JOCORNET/snort3:memory to master Squashed commit of the following: commit 2ffa5e26303c5e9f4089a231ca403a74148cc123 Author: Joel Cornett Date: Fri Feb 12 16:02:30 2016 -0500 fix to avoid null reference to memory config --- diff --git a/src/memory/memory_cap.cc b/src/memory/memory_cap.cc index ffb11d0af..275b97cdf 100644 --- a/src/memory/memory_cap.cc +++ b/src/memory/memory_cap.cc @@ -62,9 +62,12 @@ static THREAD_LOCAL Tracker s_tracker; bool DefaultCap::free_space(size_t n) { + if ( !is_packet_thread() ) + return true; + const auto& config = *snort_conf->memory; - if ( !config.enable || !config.cap || !is_packet_thread() ) + if ( !config.enable || !config.cap ) return true; // FIXIT-H call prune handler and attempt to free memory