Skip to content

Commit 9056a14

Browse files
committed
Plug a memory leak
Addressing: openscap-1.3.0_alpha3/src/OVAL/probes/probe-api.c:1262: alloc_fn: Storage is returned from allocation function "SEXP_list_first". openscap-1.3.0_alpha3/src/OVAL/probes/SEAP/sexp-manip.c:1004:9: alloc_fn: Storage is returned from allocation function "SEXP_ref". openscap-1.3.0_alpha3/src/OVAL/probes/SEAP/sexp-manip.c:1619:9: alloc_fn: Storage is returned from allocation function "SEXP_new". openscap-1.3.0_alpha3/src/OVAL/probes/SEAP/sexp-manip.c:1593:16: alloc_fn: Storage is returned from allocation function "malloc". openscap-1.3.0_alpha3/src/OVAL/probes/SEAP/sexp-manip.c:1593:16: var_assign: Assigning: "s_exp" = "malloc(16UL)". openscap-1.3.0_alpha3/src/OVAL/probes/SEAP/sexp-manip.c:1602:9: return_alloc: Returning allocated memory "s_exp". openscap-1.3.0_alpha3/src/OVAL/probes/SEAP/sexp-manip.c:1619:9: var_assign: Assigning: "s_exp_r" = "SEXP_new()". openscap-1.3.0_alpha3/src/OVAL/probes/SEAP/sexp-manip.c:1625:9: return_alloc: Returning allocated memory "s_exp_r". openscap-1.3.0_alpha3/src/OVAL/probes/SEAP/sexp-manip.c:1004:9: return_alloc_fn: Directly returning storage allocated by "SEXP_ref". openscap-1.3.0_alpha3/src/OVAL/probes/probe-api.c:1262: var_assign: Assigning: "tmp" = storage returned from "SEXP_list_first(ent_name)". openscap-1.3.0_alpha3/src/OVAL/probes/probe-api.c:1264: var_assign: Assigning: "ent_name" = "tmp". openscap-1.3.0_alpha3/src/OVAL/probes/probe-api.c:1266: noescape: Resource "ent_name" is not freed or pointed-to in "SEXP_stringp". openscap-1.3.0_alpha3/src/OVAL/probes/SEAP/sexp-manip.c:630:34: noescape: "SEXP_stringp(SEXP_t const *)" does not free or save its parameter "s_exp". openscap-1.3.0_alpha3/src/OVAL/probes/probe-api.c:1268: leaked_storage: Variable "tmp" going out of scope leaks the storage it points to. openscap-1.3.0_alpha3/src/OVAL/probes/probe-api.c:1268: leaked_storage: Variable "ent_name" going out of scope leaks the storage it points to.
1 parent 80d99c0 commit 9056a14

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/OVAL/probes/probe-api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,7 @@ char *probe_ent_getname(const SEXP_t * ent)
12641264
ent_name = tmp;
12651265

12661266
if (!SEXP_stringp(ent_name)) {
1267+
SEXP_free(ent_name);
12671268
errno = EINVAL;
12681269
return NULL;
12691270
}

0 commit comments

Comments
 (0)