Commit Diff


commit - 37bb14b5e24b86f1a44532856f9e7c1c24692c7e
commit + 0816b8e449ec4d3f96b82be1ee8f52f6d96889cf
blob - 31042a597bc4430e041b5cfe287df2250a394316
blob + 2b106528c37ad2b020d2fd97d4b3acca7ad1bdef
--- thingsd/things.c	
+++ thingsd/things.c	
@@ -299,6 +299,7 @@ things_shutdown(void)
 		TAILQ_REMOVE(thingsd_env->clients, client, entry);
 		free(client);
 	}
+	free(thingsd_env);
 }
 
 void
blob - 271fd1f4b6f7cc44c5b14665d00a1838bd9ef351
blob + 113111a6377399b66886c38e177bd6e03694d1bc
--- thingsd/thingsd.c	
+++ thingsd/thingsd.c	
@@ -420,7 +420,7 @@ void
 thingsd_shutdown(void)
 {
 	proc_kill(&thingsd_env->thingsd_ps);
-	free(thingsd_env);
+	things_shutdown();
 
 	log_warnx("parent terminating");
 	exit(0);
@@ -462,8 +462,6 @@ thingsd_configure_things(struct privsep *ps)
 
 	/* Send configured things to things. */
 	TAILQ_FOREACH(thing, thingsd_env->things, entry) {
-		memset(&nti, 0, sizeof(nti));
-
 		nti.exists = thing->exists;
 		nti.hw_ctl = thing->hw_ctl;
 		nti.persist = thing->persist;