From 2b4f0761b9290e7db99a7c51aa1a38b7787a7960 Mon Sep 17 00:00:00 2001 From: Krista 'DarthMama' Bennett Date: Mon, 26 Oct 2020 14:15:35 +0100 Subject: [PATCH] ENGINE-836: handle enomem return from elect_pubkey --- src/keymanagement.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/keymanagement.c b/src/keymanagement.c index 8c735d25..5182e464 100644 --- a/src/keymanagement.c +++ b/src/keymanagement.c @@ -804,7 +804,13 @@ DYNAMIC_API PEP_STATUS update_identity( // * create identity with user_id, address, username // (this is the input id without the fpr + comm type!) - elect_pubkey(session, identity, false); + // the only non-OK status which must be addressed here + // (and is possible) is PEP_OUT_OF_MEMORY. This function will + // disappear in the next release, so we check for this and + // handle it explicitly. + status = elect_pubkey(session, identity, false); + if (status == PEP_OUT_OF_MEMORY) + goto enomem; // * We've already checked and retrieved // any applicable temporary identities above. If we're