summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/dir.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2017-01-04 18:24:39 +0100
committerSander Vrijders <sander.vrijders@intec.ugent.be>2017-01-04 18:24:39 +0100
commite0db38c8fcd7495d990698e86212a70b8440cad0 (patch)
treeb9c1650d17e761a95cb81a4872aade40f3a9614d /src/ipcpd/normal/dir.c
parentc9b54bcd27fe87559f82b9a1cebba9b38abf5ebc (diff)
parentce64aa294574cc94355f5d744e8d0342a0f19769 (diff)
downloadouroboros-e0db38c8fcd7495d990698e86212a70b8440cad0.tar.gz
ouroboros-e0db38c8fcd7495d990698e86212a70b8440cad0.zip
Merged in dstaesse/ouroboros/be-fixes (pull request #337)
Be fixes
Diffstat (limited to 'src/ipcpd/normal/dir.c')
-rw-r--r--src/ipcpd/normal/dir.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ipcpd/normal/dir.c b/src/ipcpd/normal/dir.c
index c5bb03dd..d9d15f72 100644
--- a/src/ipcpd/normal/dir.c
+++ b/src/ipcpd/normal/dir.c
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
char * create_path(char * name)
{
@@ -94,6 +95,8 @@ int dir_name_reg(char * name)
char * path;
uint64_t * addr;
+ assert(name);
+
ro_attr_init(&attr);
attr.enrol_sync = true;
attr.recv_set = ALL_MEMBERS;
@@ -107,10 +110,12 @@ int dir_name_reg(char * name)
pathname_destroy(path);
return -ENOMEM;
}
+
*addr = ribmgr_address();
if (ro_create(path, &attr, (uint8_t *) addr, sizeof(*addr))) {
pathname_destroy(path);
+ free(addr);
LOG_ERR("Failed to create RIB object.");
return -1;
}
@@ -118,6 +123,8 @@ int dir_name_reg(char * name)
LOG_DBG("Registered %s.", name);
pathname_destroy(path);
+ free(name);
+
return 0;
}
@@ -125,6 +132,8 @@ int dir_name_unreg(char * name)
{
char * path;
+ assert(name);
+
path = create_path(name);
if (path == NULL)
return -ENOMEM;