summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-08-23 19:38:57 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-08-23 19:38:57 +0200
commit47bd452352389925188ca4d36ae1c1ba611e6aeb (patch)
tree8a307b5138b18dba0ed277d4deb85a8ca8e64347 /src/irmd/main.c
parent1ca26ab86712575a5e89dcd68295b57fd27c5703 (diff)
downloadouroboros-47bd452352389925188ca4d36ae1c1ba611e6aeb.tar.gz
ouroboros-47bd452352389925188ca4d36ae1c1ba611e6aeb.zip
lib, ipcpd, irmd: Fix several memleaks
This fixes several memleaks as reported by valgrind. It also fixes some calls to close() with -1.
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r--src/irmd/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 66c230c8..c8c75ef9 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -848,7 +848,7 @@ static int name_reg(const char * name,
continue;
hash = malloc(IPCP_HASH_LEN(e));
- if (hash == NULL)
+ if (hash == NULL)
break;
str_hash(e->dir_hash_algo, hash, name);
@@ -1827,10 +1827,8 @@ void * mainloop(void * o)
if (sfd == -1) {
pthread_mutex_unlock(&irmd.cmd_lock);
- if (tpm_check()) {
- close(sfd);
+ if (tpm_check())
break;
- }
continue;
}