aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fm.c b/src/fm.c
index 06a980c..a7e1722 100644
--- a/src/fm.c
+++ b/src/fm.c
@@ -107,8 +107,10 @@ fm_getcwd(fm_info *info)
static void
fm_file_items_realloc(file_list *l)
{
+ if (!l)
+ return;
+
l->cap *= 2;
- l->items = realloc(l->items, sizeof(file_item) * l->cap);
l->items = xrealloc(l->items, sizeof(file_item) * l->cap);
}