fixing some string alloc problems sync
authorVolker Birk <vb@pep-project.org>
Fri, 03 May 2019 10:40:31 +0200
branchsync
changeset 3609548e7dd045e5
parent 3606 341d6694d968
child 3610 97033a138011
fixing some string alloc problems
src/keymanagement.c
sync/cond_act_sync.yml2
     1.1 --- a/src/keymanagement.c	Thu May 02 13:32:32 2019 +0200
     1.2 +++ b/src/keymanagement.c	Fri May 03 10:40:31 2019 +0200
     1.3 @@ -1762,18 +1762,11 @@
     1.4          result = sqlite3_step(session->own_keys_retrieve);
     1.5          switch (result) {
     1.6              case SQLITE_ROW:
     1.7 -                fpr = strdup((const char *) sqlite3_column_text(session->own_keys_retrieve, 0));
     1.8 -                if(fpr == NULL)
     1.9 +                _bl = stringlist_add(_bl, (const char *) sqlite3_column_text(session->own_keys_retrieve, 0));
    1.10 +                if (_bl == NULL)
    1.11                      goto enomem;
    1.12 -
    1.13 -                _bl = stringlist_add(_bl, fpr);
    1.14 -                if (_bl == NULL) {
    1.15 -                    free(fpr);
    1.16 -                    goto enomem;
    1.17 -                }
    1.18                  if (_keylist == NULL)
    1.19                      _keylist = _bl;
    1.20 -                
    1.21                  break;
    1.22                  
    1.23              case SQLITE_DONE:
     2.1 --- a/sync/cond_act_sync.yml2	Thu May 02 13:32:32 2019 +0200
     2.2 +++ b/sync/cond_act_sync.yml2	Fri May 03 10:40:31 2019 +0200
     2.3 @@ -324,6 +324,7 @@
     2.4          return status;
     2.5  
     2.6      IdentityList_from_identity_list(il, &session->sync_state.keysync.ownIdentities);
     2.7 +    free_identity_list(il);
     2.8  ||
     2.9  
    2.10  action saveGroupKeys