]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dataset: fix dataset string lookup
authorEric Leblond <eric@regit.org>
Wed, 20 Jan 2021 20:17:04 +0000 (21:17 +0100)
committerJeff Lucovsky <jeff@lucovsky.org>
Mon, 15 Feb 2021 18:25:33 +0000 (13:25 -0500)
The data was unlocked but the use_cnt was not decreased resulting
in the data entry not being removable.

(cherry picked from commit 64f994f753b9109c8f788e3a6dbe4c72f6e69d94)

src/datasets.c

index bd5f1276244e211d2812766360543e190b18f419..cb4592e2c42209ebe2d9f90a45ec5746a91fc2d2 100644 (file)
@@ -705,7 +705,7 @@ static int DatasetLookupString(Dataset *set, const uint8_t *data, const uint32_t
     StringType lookup = { .ptr = (uint8_t *)data, .len = data_len, .rep.value = 0 };
     THashData *rdata = THashLookupFromHash(set->hash, &lookup);
     if (rdata) {
-        THashDataUnlock(rdata);
+        DatasetUnlockData(rdata);
         return 1;
     }
     return 0;