diff options
author | David Robillard <d@drobilla.net> | 2011-06-09 05:48:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-06-09 05:48:48 +0000 |
commit | 3b333151e8d9b245d10d28b8f5c427e3d33a1c66 (patch) | |
tree | 3a84dbdf40f6c8e9cf5e2bd8fac4c42779fa0660 /src | |
parent | 2af0d830244b5b504b1bd28c3660e9f441520856 (diff) | |
download | lilv-3b333151e8d9b245d10d28b8f5c427e3d33a1c66.tar.gz lilv-3b333151e8d9b245d10d28b8f5c427e3d33a1c66.tar.bz2 lilv-3b333151e8d9b245d10d28b8f5c427e3d33a1c66.zip |
Explicitly document free functions as safe to call on NULL.
Fix ticket #709.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3377 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/scalepoint.c | 8 | ||||
-rw-r--r-- | src/world.c | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/scalepoint.c b/src/scalepoint.c index 6995b85..0138e61 100644 --- a/src/scalepoint.c +++ b/src/scalepoint.c @@ -30,9 +30,11 @@ lilv_scale_point_new(LilvNode* value, LilvNode* label) void lilv_scale_point_free(LilvScalePoint* point) { - lilv_node_free(point->value); - lilv_node_free(point->label); - free(point); + if (point) { + lilv_node_free(point->value); + lilv_node_free(point->label); + free(point); + } } LILV_API diff --git a/src/world.c b/src/world.c index e2456dd..e94bcd8 100644 --- a/src/world.c +++ b/src/world.c @@ -100,6 +100,10 @@ LILV_API void lilv_world_free(LilvWorld* world) { + if (!world) { + return NULL; + } + lilv_plugin_class_free(world->lv2_plugin_class); world->lv2_plugin_class = NULL; |