Only touch _crypto_initialized if we actually change it
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 8 Jan 2009 11:03:55 +0000 (13:03 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 8 Jan 2009 11:03:55 +0000 (13:03 +0200)
rpmio/rpmpgp.c

index 8150057..46335b7 100644 (file)
@@ -1496,12 +1496,13 @@ char * pgpArmorWrap(int atype, const unsigned char * s, size_t ns)
 int rpmInitCrypto(void) {
     int rc = 0;
 
-    if (!_crypto_initialized && NSS_NoDB_Init(NULL) != SECSuccess) {
-       rc = -1;
-    } else {
-       _crypto_initialized = 1;
+    if (!_crypto_initialized) {
+       if (NSS_NoDB_Init(NULL) != SECSuccess) {
+           rc = -1;
+       } else {
+           _crypto_initialized = 1;
+       }
     }
-
     return rc;
 }