summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-06-11 22:01:13 +0000
committerDavid Robillard <d@drobilla.net>2011-06-11 22:01:13 +0000
commitf5f6dc573149d961b6c5df81e391a30409b7c0a3 (patch)
tree3b1872437268084b9f5533c8b42095f93023daa1
parentc69624e0e2b255b8a428974f851c81dd7899ce3c (diff)
downloadsuil-f5f6dc573149d961b6c5df81e391a30409b7c0a3.tar.gz
suil-f5f6dc573149d961b6c5df81e391a30409b7c0a3.tar.bz2
suil-f5f6dc573149d961b6c5df81e391a30409b7c0a3.zip
Make suil_host_free tolerate being called on NULL
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@3389 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/host.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/host.c b/src/host.c
index c57b1c6..9da2078 100644
--- a/src/host.c
+++ b/src/host.c
@@ -36,8 +36,10 @@ SUIL_API
void
suil_host_free(SuilHost* host)
{
- if (host->gtk_lib) {
- dlclose(host->gtk_lib);
+ if (host) {
+ if (host->gtk_lib) {
+ dlclose(host->gtk_lib);
+ }
+ free(host);
}
- free(host);
}