empty list is nothing sync
authorVolker Birk <vb@pep-project.org>
Wed, 27 Mar 2019 22:31:15 +0100
branchsync
changeset 340878506867a9c0
parent 3407 dabc9c3b13e6
child 3409 7f33fb2a7acb
empty list is nothing
src/sync_api.c
     1.1 --- a/src/sync_api.c	Wed Mar 27 20:17:29 2019 +0100
     1.2 +++ b/src/sync_api.c	Wed Mar 27 22:31:15 2019 +0100
     1.3 @@ -78,8 +78,13 @@
     1.4      free_identity_list(session->sync_state.common.own_identities);
     1.5      if (identities_sharing) {
     1.6          session->sync_state.common.own_identities = identity_list_dup(identities_sharing);
     1.7 -        if (session->sync_state.common.own_identities)
     1.8 +        if (!session->sync_state.common.own_identities)
     1.9              status = PEP_OUT_OF_MEMORY;
    1.10 +        if (!session->sync_state.common.own_identities->ident) {
    1.11 +            free_identity_list(session->sync_state.common.own_identities);
    1.12 +            session->sync_state.common.own_identities = NULL;
    1.13 +            status = own_identities_retrieve(session, &session->sync_state.common.own_identities);
    1.14 +        }
    1.15      }
    1.16      else {
    1.17          status = own_identities_retrieve(session, &session->sync_state.common.own_identities);