From a770296c7aa15057602a4e4f5c7744ccfc65b8aa Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 30 Aug 2017 13:29:18 +0200 Subject: ipcpd: Add check if name was already registered This adds a check in the shims if a name was already registered, since it should not return an error. --- src/ipcpd/shim-eth-llc/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/ipcpd/shim-eth-llc/main.c') diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index 292ecbe7..be29c585 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -993,18 +993,9 @@ static int eth_llc_ipcp_bootstrap(const struct ipcp_config * conf) static int eth_llc_ipcp_reg(const uint8_t * hash) { - uint8_t * hash_dup; - - hash_dup = ipcp_hash_dup(hash); - if (hash_dup == NULL) { - log_err("Failed to duplicate hash."); - return -ENOMEM; - } - - if (shim_data_reg_add_entry(eth_llc_data.shim_data, hash_dup)) { + if (shim_data_reg_add_entry(eth_llc_data.shim_data, hash)) { log_err("Failed to add " HASH_FMT " to local registry.", HASH_VAL(hash)); - free(hash_dup); return -1; } -- cgit v1.2.3