From: Jérémie Galarneau Date: Sat, 6 May 2017 19:20:29 +0000 (-0400) Subject: Fix: return of free'd string on error in strutils_split() X-Git-Tag: v2.11.0-rc1~603 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=190afa261ad4c77130b136c6f8b72227a9463543;p=lttng-tools.git Fix: return of free'd string on error in strutils_split() Reported-by: Coverity Scan CID 1374808 (#1 of 1): Use after free (USE_AFTER_FREE) use_after_free: Using freed pointer substrings. Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/string-utils/string-utils.c b/src/common/string-utils/string-utils.c index c91d920e5..8e1f516b6 100644 --- a/src/common/string-utils/string-utils.c +++ b/src/common/string-utils/string-utils.c @@ -355,7 +355,7 @@ char **strutils_split(const char *input, char delim, bool escape_delim) error: strutils_free_null_terminated_array_of_strings(substrings); - + substrings = NULL; end: return substrings; }