From 593e51554efafaee1d2f1d8ddc6717c21a4076a8 Mon Sep 17 00:00:00 2001 From: Flos Lonicerae Date: Sat, 19 Oct 2024 18:58:30 +0800 Subject: [PATCH] Make a copy before spliting. --- src/OVAL/probes/probe/worker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OVAL/probes/probe/worker.c b/src/OVAL/probes/probe/worker.c index 660b9888a3..b57c3fa02a 100644 --- a/src/OVAL/probes/probe/worker.c +++ b/src/OVAL/probes/probe/worker.c @@ -974,7 +974,7 @@ static SEXP_t *probe_set_eval(probe_t *probe, SEXP_t *set, size_t depth) static void _add_blocked_paths(struct oscap_list *bpaths) { - char *envar = getenv("OSCAP_PROBE_IGNORE_PATHS"); + char *envar = oscap_strdup(getenv("OSCAP_PROBE_IGNORE_PATHS")); if (envar == NULL) { return; } @@ -985,6 +985,7 @@ static void _add_blocked_paths(struct oscap_list *bpaths) for (int i = 0; paths[i]; ++i) { oscap_list_add(bpaths, strdup(paths[i])); } + free(envar); free(paths); #endif }