From d865baf7be8ca171ec2c2e142f7e15e1e76d82bf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 27 Dec 2018 14:17:18 -0500 Subject: Make sratom_free() safe to call on NULL --- src/sratom.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/sratom.c') diff --git a/src/sratom.c b/src/sratom.c index 7b00557..f3c7be9 100644 --- a/src/sratom.c +++ b/src/sratom.c @@ -97,8 +97,10 @@ sratom_new(LV2_URID_Map* map) void sratom_free(Sratom* sratom) { - serd_node_free(&sratom->base_uri); - free(sratom); + if (sratom) { + serd_node_free(&sratom->base_uri); + free(sratom); + } } void -- cgit v1.2.1