summaryrefslogtreecommitdiff
path: root/src/ipcpd/local/main.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-04 12:53:28 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-04 17:17:49 +0200
commit139001b60b32e756e947d6e3a55767be9063029d (patch)
tree45a23543682a69151622cda6100eb1656c64c773 /src/ipcpd/local/main.c
parentc9cffcf863b23e75ccb6d7800ac0d48fd1612259 (diff)
downloadouroboros-139001b60b32e756e947d6e3a55767be9063029d.tar.gz
ouroboros-139001b60b32e756e947d6e3a55767be9063029d.zip
ipcpd: Fix memory leaks
ipcp-data was not correctly destroyed.
Diffstat (limited to 'src/ipcpd/local/main.c')
-rw-r--r--src/ipcpd/local/main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c
index 4b9dcbbc..e77a0403 100644
--- a/src/ipcpd/local/main.c
+++ b/src/ipcpd/local/main.c
@@ -292,10 +292,6 @@ static int ipcp_local_name_reg(char * name)
return -1; /* -ENOTENROLLED */
}
- pthread_rwlock_unlock(&_ipcp->state_lock);
-
- pthread_rwlock_rdlock(&_ipcp->state_lock);
-
if (ipcp_data_add_reg_entry(_ipcp->data, name)) {
pthread_rwlock_unlock(&_ipcp->state_lock);
LOG_DBGF("Failed to add %s to local registry.", name);
@@ -627,7 +623,8 @@ int main(int argc, char * argv[])
shim_ap_fini();
- free(_ipcp->data);
+ ipcp_data_destroy(_ipcp->data);
+
free(_ipcp->ops);
free(_ipcp);