safeguard sync
authorVolker Birk <vb@pep-project.org>
Tue, 28 May 2019 17:08:29 +0200
branchsync
changeset 37547d9c7bc6f412
parent 3747 82fe58af7b53
child 3755 df87c9865aa9
safeguard
sync/cond_act_sync.yml2
     1.1 --- a/sync/cond_act_sync.yml2	Tue May 28 12:09:20 2019 +0200
     1.2 +++ b/sync/cond_act_sync.yml2	Tue May 28 17:08:29 2019 +0200
     1.3 @@ -416,18 +416,25 @@
     1.4      if (!(session->sync_state.common.from && session->sync_state.common.signature_fpr))
     1.5          return PEP_ILLEGAL_VALUE;
     1.6  
     1.7 -    pEp_identity *ident = session->sync_state.common.from;
     1.8 +    pEp_identity *ident = identity_dup(session->sync_state.common.from);
     1.9 +    if (!ident)
    1.10 +        return PEP_OUT_OF_MEMORY;
    1.11      free(ident->fpr);
    1.12      ident->fpr = strdup(session->sync_state.common.signature_fpr);
    1.13      assert(ident->fpr);
    1.14 -    if (!ident->fpr)
    1.15 +    if (!ident->fpr) {
    1.16 +        free_identity(ident);
    1.17          return PEP_OUT_OF_MEMORY;
    1.18 +    }
    1.19  
    1.20      PEP_STATUS status = trust_own_key(session, ident);
    1.21 -    if (status)
    1.22 +    if (status) {
    1.23 +        free_identity(ident);
    1.24          return status;
    1.25 +    }
    1.26  
    1.27      OCTET_STRING_fromBuf(&session->sync_state.keysync.key, ident->fpr, strlen(ident->fpr));
    1.28 +    free_identity(ident);
    1.29  ||
    1.30  
    1.31  action untrustThisKey