Commit fab7fb88 authored by George Nash's avatar George Nash Committed by Kishen Maloor

Free ACE in provisioning functions on failure

If the provisioning functions
- oc_obt_provision_role_wildcard_ace and
- oc_obt_provision_auth_wildcard_ace

return failure after the ACE is created this will free
that ACE when the code returns.

An update to the a PRINT in the  obtmain.c code to make it
easyer to read in the code.
Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
parent 1325cb2c
Pipeline #878 passed with stage
in 7 minutes and 19 seconds
......@@ -1446,10 +1446,10 @@ provision_ace2(void)
PRINT("\nSet wildcard resource? [0-No, 1-Yes]: ");
SCANF("%d", &c);
if (c == 1) {
PRINT("[1]: All NCRs '*' \n[2]: All NCRs with >=1 secured endpoint "
"'+'\n[3]: "
"All NCRs with >=1 unsecured endpoint '-'\n\nSelect wildcard "
"resource: ");
PRINT("[1]: All NCRs '*' \n"
"[2]: All NCRs with >=1 secured endpoint '+'\n"
"[3]: All NCRs with >=1 unsecured endpoint '-'\n"
"\nSelect wildcard resource: ");
SCANF("%d", &c);
switch (c) {
case 1:
......
......@@ -1539,6 +1539,7 @@ oc_obt_provision_role_wildcard_ace(oc_uuid_t *subject, const char *role,
res = oc_obt_ace_new_resource(ace);
if (!res) {
oc_obt_free_ace(ace);
goto exit_aceprov_role_wc;
}
......@@ -1570,6 +1571,7 @@ oc_obt_provision_auth_wildcard_ace(oc_uuid_t *subject,
res = oc_obt_ace_new_resource(ace);
if (!res) {
oc_obt_free_ace(ace);
goto exit_aceprov_ac_wc;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment