Skip to content

Commit 76537af

Browse files
committed
Plug a memeory leak
openscap-1.3.0_alpha3/src/OVAL/probes/probe-api.c:1305: 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:1305: var_assign: Assigning: "tmp" = storage returned from "SEXP_list_first(ent_name)". openscap-1.3.0_alpha3/src/OVAL/probes/probe-api.c:1307: var_assign: Assigning: "ent_name" = "tmp". openscap-1.3.0_alpha3/src/OVAL/probes/probe-api.c:1309: 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:1311: 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:1311: leaked_storage: Variable "ent_name" going out of scope leaks the storage it points to.
1 parent 9056a14 commit 76537af

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
@@ -1308,6 +1308,7 @@ size_t probe_ent_getname_r(const SEXP_t * ent, char *buffer, size_t buflen)
13081308
ent_name = tmp;
13091309

13101310
if (!SEXP_stringp(ent_name)) {
1311+
SEXP_free(ent_name);
13111312
errno = EINVAL;
13121313
return name_len;
13131314
}

0 commit comments

Comments
 (0)