diff options
author | Sander Vrijders <[email protected]> | 2017-01-29 16:33:00 +0000 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2017-01-29 16:33:00 +0000 |
commit | 9728a845eb6896219b7653640fb2b8d39da1bc83 (patch) | |
tree | 608fa2506c847f7ebe1fb702333a74ecc2792bf5 /src | |
parent | 4150bf0c6aa6b2bdabb43a32a3e127ae3e50507d (diff) | |
parent | 45a8dd4ccb3874c411dac287cf7ce862f051aa14 (diff) | |
download | ouroboros-9728a845eb6896219b7653640fb2b8d39da1bc83.tar.gz ouroboros-9728a845eb6896219b7653640fb2b8d39da1bc83.zip |
Merged in dstaesse/ouroboros/be-irmd (pull request #355)
irmd: Fix memleak attempting double bootstrap
Diffstat (limited to 'src')
-rw-r--r-- | src/irmd/main.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c index 435ee116..02ffb21b 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -392,21 +392,19 @@ static int bootstrap_ipcp(pid_t api, dif_config_msg_t * conf) return -1; } - entry->dif_name = strdup(conf->dif_name); - if (entry->dif_name == NULL) { + if (ipcp_bootstrap(entry->api, conf)) { pthread_rwlock_unlock(&irmd->reg_lock); pthread_rwlock_unlock(&irmd->state_lock); - LOG_ERR("Failed to strdup."); + LOG_ERR("Could not bootstrap IPCP."); return -1; } - if (ipcp_bootstrap(entry->api, conf)) { + entry->dif_name = strdup(conf->dif_name); + if (entry->dif_name == NULL) { pthread_rwlock_unlock(&irmd->reg_lock); pthread_rwlock_unlock(&irmd->state_lock); - LOG_ERR("Could not bootstrap IPCP."); - free(entry->dif_name); - entry->dif_name = NULL; - return -1; + LOG_WARN("Failed to set name of DIF."); + return -ENOMEM; } pthread_rwlock_unlock(&irmd->reg_lock); |