From 166a03c7c602a2c38c6be5ad9636faca15d30030 Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Mon, 24 Aug 2015 22:32:22 +0930 Subject: [PATCH] Remove useless safety checks --- keyring.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/keyring.c b/keyring.c index 924c45ba..5f733114 100644 --- a/keyring.c +++ b/keyring.c @@ -1198,7 +1198,6 @@ int keyring_enter_pin(keyring_file *k, const char *pin) { IN(); DEBUGF(keyring, "k=%p, pin=%s", k, alloca_str_toprint(pin)); - if (!k) RETURN(-1); if (!pin) pin=""; // Check if PIN is already entered. @@ -1300,7 +1299,6 @@ keyring_identity *keyring_create_identity(keyring_file *k, const char *pin) { DEBUGF(keyring, "k=%p", k); /* Check obvious abort conditions early */ - if (!k) { WHY("keyring is NULL"); return NULL; } if (!k->bam) { WHY("keyring lacks BAM (not to be confused with KAPOW)"); return NULL; } if (!pin) pin=""; @@ -1348,8 +1346,6 @@ keyring_identity *keyring_create_identity(keyring_file *k, const char *pin) int keyring_commit(keyring_file *k) { DEBUGF(keyring, "k=%p", k); - if (!k) - return WHY("keyring was NULL"); unsigned errorCount = 0; /* Write all BAMs */ keyring_bam *b; @@ -1408,10 +1404,6 @@ int keyring_commit(keyring_file *k) int keyring_set_did(keyring_identity *id, const char *did, const char *name) { - if (!id) return WHY("id is null"); - if (!did) return WHY("did is null"); - if (!name) name="Mr. Smith"; - /* Find where to put it */ keypair *kp = id->keypairs; while(kp){