summaryrefslogtreecommitdiff
path: root/src/analysis/scan/exprs/setcounter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/scan/exprs/setcounter.c')
-rw-r--r--src/analysis/scan/exprs/setcounter.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/analysis/scan/exprs/setcounter.c b/src/analysis/scan/exprs/setcounter.c
index 14e7676..da37746 100644
--- a/src/analysis/scan/exprs/setcounter.c
+++ b/src/analysis/scan/exprs/setcounter.c
@@ -319,6 +319,7 @@ static ScanReductionState g_scan_set_match_counter_reduce(const GScanSetMatchCou
ScanReductionState result; /* Etat synthétisé à retourner */
size_t matched; /* Qté de motifs avec résultats*/
size_t i; /* Boucle de parcours */
+ GScanMatches *matches; /* Série de correspondances */
size_t count; /* Quantité de correspondances */
bool status; /* Bilan d'évaluation finale */
@@ -328,10 +329,18 @@ static ScanReductionState g_scan_set_match_counter_reduce(const GScanSetMatchCou
for (i = 0; i < expr->count; i++)
{
- g_scan_context_get_full_matches(ctx, expr->patterns[i], &count);
+ matches = g_scan_context_get_full_matches(ctx, expr->patterns[i]);
- if (count > 0)
- matched++;
+ if (matches != NULL)
+ {
+ count = g_scan_matches_count(matches);
+
+ if (count > 0)
+ matched++;
+
+ g_object_unref(G_OBJECT(matches));
+
+ }
}