Ensure that memory for the reputation key is released on failed adds.
Contributed by Giuseppe Longo <giuseppe@glongo.it>
Issue: 5748
SCLogDebug("adding ipv6 host %s", ip);
if (SCRadixAddKeyIPV6String(ip, cidr_ctx->srepIPV6_tree[cat], (void *)user_data) == NULL) {
+ SCFree(user_data);
SCLogWarning("failed to add ipv6 host %s", ip);
}
SCLogDebug("adding ipv4 host %s", ip);
if (SCRadixAddKeyIPV4String(ip, cidr_ctx->srepIPV4_tree[cat], (void *)user_data) == NULL) {
+ SCFree(user_data);
SCLogWarning("failed to add ipv4 host %s", ip);
}
}