src/keymanagement.c
changeset 2522 70df192d5904
parent 2520 a8704b38e8fb
child 2535 76edc488ccdd
child 2538 be573c5f4782
     1.1 --- a/src/keymanagement.c	Mon Feb 19 13:59:49 2018 +0100
     1.2 +++ b/src/keymanagement.c	Mon Feb 19 15:34:10 2018 +0100
     1.3 @@ -1321,7 +1321,7 @@
     1.4          goto pep_free;
     1.5      }
     1.6      
     1.7 -    // Save the input fpr
     1.8 +    // Save the input fpr, which we already tested as non-NULL
     1.9      cached_fpr = strdup(ident->fpr);
    1.10  
    1.11      // First, set up a temp trusted identity for the input fpr without a comm type;
    1.12 @@ -1335,7 +1335,7 @@
    1.13                                         
    1.14          // Get the default identity without setting the fpr
    1.15          status = update_identity(session, ident_copy);
    1.16 -        ident_default_fpr = strdup(ident_copy->fpr);
    1.17 +        ident_default_fpr = (EMPTYSTR(ident_copy->fpr) ? NULL : strdup(ident_copy->fpr));
    1.18  
    1.19          if (status == PEP_STATUS_OK) {
    1.20              bool trusted_default = false;