diff options
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/normal/fmgr.c | 4 | ||||
-rw-r--r-- | src/ipcpd/normal/ribmgr.c | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c index 64d9a5a9..b0a37ee1 100644 --- a/src/ipcpd/normal/fmgr.c +++ b/src/ipcpd/normal/fmgr.c @@ -229,7 +229,7 @@ int fmgr_init() for (i = 0; i < QOS_CUBE_MAX; ++i) { fmgr.np1_set[i] = flow_set_create(); - if (fmgr.np1_set == NULL) { + if (fmgr.np1_set[i] == NULL) { fmgr_destroy_flows(); return -1; } @@ -241,7 +241,7 @@ int fmgr_init() } fmgr.nm1_set[i] = flow_set_create(); - if (fmgr.nm1_set == NULL) { + if (fmgr.nm1_set[i] == NULL) { fmgr_destroy_flows(); return -1; } diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index ab492e7f..d0bd3ec7 100644 --- a/src/ipcpd/normal/ribmgr.c +++ b/src/ipcpd/normal/ribmgr.c @@ -312,13 +312,13 @@ static struct rnode * ribmgr_ro_create(const char * name, { char * str; char * str1; - char * saveptr; - char * token; + char * saveptr = NULL; + char * token = NULL; char * token2; struct rnode * node; struct rnode * new; struct rnode * prev; - bool sibling; + bool sibling = false; int timeout; str = strdup(name); @@ -327,6 +327,8 @@ static struct rnode * ribmgr_ro_create(const char * name, node = rib.root; + assert(node); + for (str1 = str; node != NULL; str1 = NULL) { token = strtok_r(str1, PATH_DELIMITER, &saveptr); if (token == NULL) { @@ -351,6 +353,8 @@ static struct rnode * ribmgr_ro_create(const char * name, } } + assert(token); + token2 = strtok_r(NULL, PATH_DELIMITER, &saveptr); if (token2 != NULL) { LOG_ERR("Part of the pathname does not exist."); |