From 29bb779084d76fb31e1b5dfbf54995918d02fc0e Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Thu, 31 Oct 2019 17:02:17 +0100 Subject: [HICN-372] Code clean up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic0ce2d01a05c2724eeaf91f76aafa2facedcbaf3 Signed-off-by: Jordan Augé --- ctrl/facemgr/src/interface.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'ctrl/facemgr/src/interface.c') diff --git a/ctrl/facemgr/src/interface.c b/ctrl/facemgr/src/interface.c index 72a78ef56..d592bf04c 100644 --- a/ctrl/facemgr/src/interface.c +++ b/ctrl/facemgr/src/interface.c @@ -53,19 +53,21 @@ interface_unregister_all() int n = interface_ops_map_get_key_array(interface_ops_map, &ops_name_array); if (n < 0) { ERROR("[interface_unregister_all] Could not get interface ops array"); - ret = -1; - } else { - for (unsigned i = 0; i < n; i++) { - const char * ops_name = ops_name_array[i]; - if (interface_ops_map_remove(interface_ops_map, ops_name, NULL) < 0) { - ERROR("[interface_unregister_all] Could not remove %s from interface ops map", ops_name); - ret = -1; - } + return -1; + } + + for (unsigned i = 0; i < n; i++) { + const char * ops_name = ops_name_array[i]; + if (interface_ops_map_remove(interface_ops_map, ops_name, NULL) < 0) { + ERROR("[interface_unregister_all] Could not remove %s from interface ops map", ops_name); + ret = -1; } - free(ops_name_array); } + free(ops_name_array); + interface_ops_map_free(interface_ops_map); interface_ops_map = NULL; + return ret; } -- cgit 1.2.3-korg