aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/core/str.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/core/str.c b/src/lib/core/str.c
index 400c93c..84a325b 100644
--- a/src/lib/core/str.c
+++ b/src/lib/core/str.c
@@ -171,6 +171,10 @@ char *join(char **arr, const char *separator) {
total_bytes += (records * strlen(separator)) + 1;
result = (char *)calloc(total_bytes, sizeof(char));
+ if (!result) {
+ return NULL;
+ }
+
for (int i = 0; i < records; i++) {
safe_strncat(result, arr[i], total_bytes);
if (i < (records - 1)) {