Return NULL when tr_cfg_parse_one_apc() fails
[trust_router.git] / common / tr_config_realms.c
index 60bae00..3c189ee 100644 (file)
@@ -187,6 +187,9 @@ TR_APC *tr_cfg_parse_apcs(TALLOC_CTX *mem_ctx, json_t *japcs, TR_CFG_RC *rc)
   *rc=TR_CFG_SUCCESS;
 
 cleanup:
+  if (*rc != TR_CFG_SUCCESS)
+    apcs = NULL;
+
   talloc_free(tmp_ctx);
   return apcs;
 }