summaryrefslogtreecommitdiffstats
path: root/src/sratom.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-27 14:17:18 -0500
committerDavid Robillard <d@drobilla.net>2018-12-27 14:17:27 -0500
commitd865baf7be8ca171ec2c2e142f7e15e1e76d82bf (patch)
tree7bfce9474fb10764a10aa9cd9761f57858f3dd06 /src/sratom.c
parentfb88a51162097d1117ea8b96958aa98e2fcbf2a3 (diff)
downloadsratom-d865baf7be8ca171ec2c2e142f7e15e1e76d82bf.tar.gz
sratom-d865baf7be8ca171ec2c2e142f7e15e1e76d82bf.tar.bz2
sratom-d865baf7be8ca171ec2c2e142f7e15e1e76d82bf.zip
Make sratom_free() safe to call on NULL
Diffstat (limited to 'src/sratom.c')
-rw-r--r--src/sratom.c6
1 files changed, 4 insertions, 2 deletions
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