summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/textarea.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index ece529e48..573da1d1d 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -934,10 +934,9 @@ static bool textarea_reflow_multiline(struct textarea *ta,
assert(ta->flags & TEXTAREA_MULTILINE);
if (ta->lines == NULL) {
- ta->lines =
- malloc(LINE_CHUNK_SIZE * sizeof(struct line_info));
+ ta->lines = calloc(sizeof(struct line_info), LINE_CHUNK_SIZE);
if (ta->lines == NULL) {
- LOG(("malloc failed"));
+ LOG(("Failed to allocate memory for textarea lines"));
return false;
}
ta->lines_alloc_size = LINE_CHUNK_SIZE;