diff --git a/src/core/cntlr_map.c b/src/core/cntlr_map.c
index 9fa81a59fc974b13815538dbd7cfc1d9b54ccbff..9730a1ad0ba5b43a2023eeb5950afc24d4aa73f8 100644
--- a/src/core/cntlr_map.c
+++ b/src/core/cntlr_map.c
@@ -441,7 +441,7 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rx_cmdu)
 						UCI_TYPE_STRING);
 
 				ret = ubus_lookup_id(c->ubus_ctx, "uci", &uci_obj);
-				if (ret) {
+				if (!ret) {
 					struct blob_buf bb = {0};
 
 					blob_buf_init(&bb, 0);
@@ -451,12 +451,9 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rx_cmdu)
 							"commit", bb.head,
 							NULL, NULL,
 							2 * 1000);
-					if (ret) {
+					if (ret)
 						err("Failed to get 'commit' (ret = %d), exit anyway\n",
 								ret);
-						blob_buf_free(&bb);
-						exit(0);
-					}
 					blob_buf_free(&bb);
 				}