Skip to content

Commit

Permalink
Fix leak of item in probe_item_collect
Browse files Browse the repository at this point in the history
  • Loading branch information
0intro committed Jul 19, 2023
1 parent 9f83ba0 commit 8359208
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/OVAL/probes/probe/icache.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,11 @@ int probe_item_collect(struct probe_ctx *ctx, SEXP_t *item)
memcheck_ret = probe_cobj_memcheck(cobj_itemcnt, ctx->max_mem_ratio);
if (memcheck_ret == -1) {
dE("Failed to check available memory");
SEXP_free(item);
return -1;
}
if (memcheck_ret == 1) {
SEXP_free(item);

/*
* Don't set the message again if the collected object is
Expand Down

0 comments on commit 8359208

Please sign in to comment.