Fix: return of free'd string on error in strutils_split()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 6 May 2017 19:20:29 +0000 (15:20 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 6 May 2017 19:43:28 +0000 (15:43 -0400)
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 <jeremie.galarneau@efficios.com>
src/common/string-utils/string-utils.c

index c91d920e527799acec92b97b81108b32ce4c46df..8e1f516b6833eb96796e8bbf64cc33bb8d02e383 100644 (file)
@@ -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;
 }
This page took 0.026455 seconds and 5 git commands to generate.