From ae4066dcf8dce6fab8957408595b1ddba9982c38 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Tue, 14 Aug 2012 17:16:53 -0700 Subject: [PATCH] Fixing problem with type list. --- src/bro.bif | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bro.bif b/src/bro.bif index 4c07053981..42191d3b22 100644 --- a/src/bro.bif +++ b/src/bro.bif @@ -5902,11 +5902,15 @@ function hll_cardinality_add%(elem: any, index: any%): bool int status = 0; uint64_t a = 123456; - CompositeHash* hll_hash = new CompositeHash(new TypeList(elem->Type())); - if(hll_counters.count(*s) > 0) + TypeList* tl = new TypeList(elem->Type()); + tl->Append(elem->Type()); + CompositeHash* hll_hash = new CompositeHash(tl); + Unref(tl); + + if( hll_counters.count(*s) > 0 ) { CardinalityCounter* h = hll_counters[*s]; - HashKey* key = hll_hash->ComputeHash(elem,1); + HashKey* key = hll_hash->ComputeHash(elem, 1); a = (key->Hash()); h->addElement(a); status = 1;