Memory leak fixes.

git-svn-id: svn://10.0.0.236/trunk@101757 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
relyea%netscape.com
2001-08-24 18:34:34 +00:00
parent e9c570e73a
commit dadc39c1fb
3 changed files with 35 additions and 3 deletions

View File

@@ -35,7 +35,7 @@
* Support for DEcoding ASN.1 data based on BER/DER (Basic/Distinguished
* Encoding Rules).
*
* $Id: secasn1d.c,v 1.8 2001-05-09 22:40:22 kirke%netscape.com Exp $
* $Id: secasn1d.c,v 1.9 2001-08-24 18:34:33 relyea%netscape.com Exp $
*/
#include "secasn1.h"
@@ -1349,9 +1349,19 @@ sec_asn1d_parse_bit_string (sec_asn1d_state *state,
{
unsigned char byte;
PORT_Assert (state->pending > 0);
/*PORT_Assert (state->pending > 0); */
PORT_Assert (state->place == beforeBitString);
if (state->pending == 0) {
if (state->dest != NULL) {
SECItem *item = (SECItem *)(state->dest);
item->data = NULL;
item->len = 0;
state->place = beforeEndOfContents;
return 0;
}
}
if (len == 0) {
state->top->status = needBytes;
return 0;

View File

@@ -1531,3 +1531,20 @@ SECOID_FindOIDTagDescription(SECOidTag tagnum)
else
return oidData->desc;
}
/*
* free up the oid tables.
*/
SECStatus
SECOID_Shutdown(void)
{
if (oidhash) {
(oidhash->close)(oidhash);
oidhash = NULL;
}
if (oidmechhash) {
(oidmechhash->close)(oidmechhash);
oidmechhash = NULL;
}
return SECSuccess;
}

View File

@@ -36,7 +36,7 @@
/*
* secoid.h - public data structures and prototypes for ASN.1 OID functions
*
* $Id: secoid.h,v 1.3 2001-05-02 21:34:13 wtc%netscape.com Exp $
* $Id: secoid.h,v 1.4 2001-08-24 18:34:34 relyea%netscape.com Exp $
*/
#include "plarena.h"
@@ -109,6 +109,11 @@ extern PRBool SECOID_KnownCertExtenOID (SECItem *extenOid);
*/
extern const char *SECOID_FindOIDTagDescription(SECOidTag tagnum);
/*
* free up the oid data structures.
*/
extern SECStatus SECOID_Shutdown(void);
SEC_END_PROTOS