aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor.c2
-rw-r--r--text.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/editor.c b/editor.c
index 455ed5b..e892c09 100644
--- a/editor.c
+++ b/editor.c
@@ -377,6 +377,8 @@ err:
}
void editor_free(Editor *ed) {
+ if (!ed)
+ return;
while (ed->windows)
editor_window_close(ed->windows);
editor_prompt_free(ed->prompt);
diff --git a/text.c b/text.c
index 56332db..7338415 100644
--- a/text.c
+++ b/text.c
@@ -457,6 +457,8 @@ static Change *change_alloc(Text *txt, size_t pos) {
}
static void change_free(Change *c) {
+ if (!c)
+ return;
/* only free the new part of the span, the old one is still in use */
piece_free(c->new.start);
if (c->new.start != c->new.end)