ENGINE-204 merged into default
authorEdouard Tisserant <edouard@pep-project.org>
Thu, 15 Jun 2017 13:26:34 +0200
changeset 1862881f5a1d8a40
parent 1859 acf5c59a49e3
parent 1745 373a181d7185
child 1863 c9c47bbd0dcd
ENGINE-204 merged into default
src/message_api.c
     1.1 --- a/src/message_api.c	Thu Jun 15 10:52:50 2017 +0200
     1.2 +++ b/src/message_api.c	Thu Jun 15 13:26:34 2017 +0200
     1.3 @@ -995,8 +995,13 @@
     1.4          if (bl && bl->value && bl->size && bl->size < MAX_KEY_SIZE
     1.5                  && is_key(bl))
     1.6          {
     1.7 -            import_key(session, bl->value, bl->size, private_idents);
     1.8 +            identity_list *local_private_idents = NULL;
     1.9 +            import_key(session, bl->value, bl->size, &local_private_idents);
    1.10              remove = true;
    1.11 +            if (*private_idents == NULL && local_private_idents != NULL)
    1.12 +                *private_idents = local_private_idents;
    1.13 +            else
    1.14 +                free_identity_list(local_private_idents);
    1.15          }
    1.16      }
    1.17      return remove;