summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 789f5a6..b534ffd 100644
--- a/src/util.c
+++ b/src/util.c
@@ -65,7 +65,12 @@ lilv_strjoin(const char* first, ...)
break;
const size_t this_len = strlen(s);
- result = (char*)realloc(result, len + this_len + 1);
+ if (!(result = (char*)realloc(result, len + this_len + 1))) {
+ free(result);
+ LILV_ERROR("realloc() failed\n");
+ return NULL;
+ }
+
memcpy(result + len, s, this_len);
len += this_len;
}