Commit Diff


commit - 6399317229fecd3f66b97e59a49e9ba0c8b3ffef
commit + 24ffb139191238b206dc06c73aa1d9e62b84e1a7
blob - cd792694a80c21a597816e533adeabc69ffbd3fa
blob + ebf1f89e9b0a3fbe0507873680fdddc97eacc91f
--- thingsctl/thingsctl.c	
+++ thingsctl/thingsctl.c	
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2019 - 2020 Tracey Emery <tracey@traceyemery.net>
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
  * Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -69,7 +70,9 @@ main(int argc, char *argv[])
 	int			 type;
 	char			*sockname, *ctl_pkt;
 
-	sockname = THINGSD_SOCK;
+	sockname = strdup(THINGSD_SOCK);
+	if (sockname == NULL)
+		err(1, "strdup");
 	while ((ch = getopt(argc, argv, "s:")) != -1) {
 		switch (ch) {
 		case 's':
@@ -209,6 +212,7 @@ main(int argc, char *argv[])
 	}
 	close(ctl_sock);
 	free(ibuf);
+	free(sockname);
 
 	return (0);
 }
blob - c5fbef05f92091c5d41797cde55c5dceaa591db3
blob + 97618eb47412c18f85263cf25273ea6ef5735878
--- thingsd/sockets.c	
+++ thingsd/sockets.c	
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2019 Tracey Emery <tracey@traceyemery.net>
+ * Copyright (c) 2016, 2019-2020 Tracey Emery <tracey@traceyemery.net>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -91,7 +91,7 @@ create_socks(struct thgsd *pthgsd, bool reconn)
 				thg->exists = true;
 			thg->fd = conn_sock->fd;
 		}
- recreate:
+recreate:
 		if (thg->ipaddr != NULL) {
 			thg->type = TCP;
 			if (thg->persist == 1) {