summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}