Merge with sync sequoia_windows
authorThomas
Fri, 31 May 2019 12:51:28 +0200
branchsequoia_windows
changeset 37958a86eb681032
parent 3793 935bbb4282b3
parent 3794 e7f94d975542
child 3800 fb9769f33508
Merge with sync
src/pgp_sequoia.c
     1.1 --- a/src/pgp_sequoia.c	Fri May 31 07:55:22 2019 +0200
     1.2 +++ b/src/pgp_sequoia.c	Fri May 31 12:51:28 2019 +0200
     1.3 @@ -190,7 +190,7 @@
     1.4      if (!home_env)
     1.5          home_env = getenv("LOCALAPPDATA");
     1.6  #else
     1.7 -    #define PEP_KEYS_PATH "/keys.db"
     1.8 +    #define PEP_KEYS_PATH "/.pEp_keys.db"
     1.9  
    1.10      if (!home_env)
    1.11          home_env = getenv("HOME");
     2.1 --- a/sync/cond_act_sync.yml2	Fri May 31 07:55:22 2019 +0200
     2.2 +++ b/sync/cond_act_sync.yml2	Fri May 31 12:51:28 2019 +0200
     2.3 @@ -364,8 +364,10 @@
     2.4          return status;
     2.5  
     2.6      identity_list *il = IdentityList_to_identity_list(&session->sync_state.keysync.ownIdentities, NULL);
     2.7 -    if (!il)
     2.8 +    if (!il) {
     2.9 +        free(user_id);
    2.10          return PEP_OUT_OF_MEMORY;
    2.11 +    }
    2.12      
    2.13      identity_list *oil = session->sync_state.own.identities;
    2.14  
    2.15 @@ -377,11 +379,18 @@
    2.16          status = is_own_address(session, ident->address, &is_own_already);
    2.17          if (status) {
    2.18              free_identity_list(il);
    2.19 +            free(user_id);
    2.20              return status;
    2.21          }
    2.22  
    2.23          free(ident->user_id);
    2.24 -        ident->user_id = user_id;
    2.25 +        ident->user_id = strdup(user_id);
    2.26 +        assert(ident->user_id);
    2.27 +        if (!ident->user_id) {
    2.28 +            free_identity_list(il);
    2.29 +            free(user_id);
    2.30 +            return PEP_OUT_OF_MEMORY;
    2.31 +        }
    2.32  
    2.33          if (is_own_already) {
    2.34              ident->comm_type = PEP_ct_pEp;
    2.35 @@ -391,16 +400,19 @@
    2.36              oil = identity_list_add(oil, ident);
    2.37              if (!oil) {
    2.38                  free_identity_list(il);
    2.39 +                free(user_id);
    2.40                  return PEP_OUT_OF_MEMORY;
    2.41              }
    2.42              status = myself(session, ident);
    2.43          }
    2.44          if (status) {
    2.45              free_identity_list(il);
    2.46 +            free(user_id);
    2.47              return status;
    2.48          }
    2.49      }
    2.50  
    2.51 +    free(user_id);
    2.52      free_identity_list(il);
    2.53  ||
    2.54