From 87f3451f2d2e992da862bce71816fbeb548513c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 14 Sep 2014 08:48:07 +0200 Subject: All *_free(...) functions should accept a NULL argument --- text.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'text.c') 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) -- cgit v1.2.3