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.10.0-rc2~82 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=dafa89697320e08be2f46d9c065c309778b8496f;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; }