summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-01-08 04:23:05 +0000
committerDavid Robillard <d@drobilla.net>2012-01-08 04:23:05 +0000
commitabd4d49c65afd967c813822a34b80b5a95bdebc3 (patch)
tree64ff5fc000879b4f71d16c7edf429430e8957c7d /src
parent1c18b0ba64be0e03867b95dff80bed3b4568c57b (diff)
downloadlilv-abd4d49c65afd967c813822a34b80b5a95bdebc3.tar.gz
lilv-abd4d49c65afd967c813822a34b80b5a95bdebc3.tar.bz2
lilv-abd4d49c65afd967c813822a34b80b5a95bdebc3.zip
Fix crash on corrupt plugins (fix #800).
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3922 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/port.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/port.c b/src/port.c
index b14f43a..037fc97 100644
--- a/src/port.c
+++ b/src/port.c
@@ -39,10 +39,12 @@ lilv_port_new(LilvWorld* world,
void
lilv_port_free(const LilvPlugin* plugin, LilvPort* port)
{
- sord_node_free(plugin->world->world, port->node);
- lilv_nodes_free(port->classes);
- lilv_node_free(port->symbol);
- free(port);
+ if (port) {
+ sord_node_free(plugin->world->world, port->node);
+ lilv_nodes_free(port->classes);
+ lilv_node_free(port->symbol);
+ free(port);
+ }
}
LILV_API