summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/hx509/crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal/lib/hx509/crypto.c')
-rw-r--r--source4/heimdal/lib/hx509/crypto.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/heimdal/lib/hx509/crypto.c b/source4/heimdal/lib/hx509/crypto.c
index e0f00ad7b4..9334a4a847 100644
--- a/source4/heimdal/lib/hx509/crypto.c
+++ b/source4/heimdal/lib/hx509/crypto.c
@@ -32,7 +32,7 @@
*/
#include "hx_locl.h"
-RCSID("$Id: crypto.c 22435 2008-01-14 20:53:56Z lha $");
+RCSID("$Id: crypto.c 22855 2008-04-07 18:49:24Z lha $");
struct hx509_crypto;
@@ -1592,11 +1592,11 @@ _hx509_private_key_init(hx509_private_key *key,
hx509_private_key
_hx509_private_key_ref(hx509_private_key key)
{
- if (key->ref <= 0)
- _hx509_abort("refcount <= 0");
- key->ref++;
if (key->ref == 0)
- _hx509_abort("refcount == 0");
+ _hx509_abort("key refcount <= 0 on ref");
+ key->ref++;
+ if (key->ref == UINT_MAX)
+ _hx509_abort("key refcount == UINT_MAX on ref");
return key;
}
@@ -1612,8 +1612,8 @@ _hx509_private_key_free(hx509_private_key *key)
if (key == NULL || *key == NULL)
return 0;
- if ((*key)->ref <= 0)
- _hx509_abort("refcount <= 0");
+ if ((*key)->ref == 0)
+ _hx509_abort("key refcount == 0 on free");
if (--(*key)->ref > 0)
return 0;