Return NULL when tr_cfg_parse_one_apc() fails
authorJennifer Richards <jennifer@painless-security.com>
Fri, 1 Jun 2018 00:46:07 +0000 (20:46 -0400)
committerJennifer Richards <jennifer@painless-security.com>
Fri, 1 Jun 2018 00:46:07 +0000 (20:46 -0400)
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;
 }