]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #265 in SNORT/snort3 from ~JOCORNET/snort3:memory to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Fri, 12 Feb 2016 21:05:27 +0000 (16:05 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Fri, 12 Feb 2016 21:05:27 +0000 (16:05 -0500)
Squashed commit of the following:

commit 2ffa5e26303c5e9f4089a231ca403a74148cc123
Author: Joel Cornett <joel.cornett@gmail.com>
Date:   Fri Feb 12 16:02:30 2016 -0500

    fix to avoid null reference to memory config

src/memory/memory_cap.cc

index ffb11d0af52113d199453be920dcc6450bd77292..275b97cdfe489eadd06bbd99a092e5dc98abf54f 100644 (file)
@@ -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