diff options
| -rw-r--r-- | src/lib/core/str.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/core/str.c b/src/lib/core/str.c index b04dfed..a08bd2b 100644 --- a/src/lib/core/str.c +++ b/src/lib/core/str.c @@ -587,6 +587,10 @@ char **strdup_array(char **array) { // Create new array result = calloc(elems + 1, sizeof(*result)); + if (!result) { + SYSERROR("%s", "could not allocate memory for result array"); + return NULL; + } for (size_t i = 0; i < elems; i++) { result[i] = strdup(array[i]); if (!result[i]) { |
