summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormcgreer%netscape.com <devnull@localhost>2000-05-15 20:54:35 +0000
committermcgreer%netscape.com <devnull@localhost>2000-05-15 20:54:35 +0000
commitfd6486110e90a9e686c8ab9801caf1ded08773d3 (patch)
tree706cb23e278f068867dc844fd02bb0363060a36e
parent24151266e3a611a2bb5fce67d948fb90d9695af5 (diff)
downloadnss-hg-fd6486110e90a9e686c8ab9801caf1ded08773d3.tar.gz
Changed DestroyContext functions so that freeit means free everything or free nothing, not just the context pointer.
-rw-r--r--security/nss/lib/freebl/blapi_bsf.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/security/nss/lib/freebl/blapi_bsf.c b/security/nss/lib/freebl/blapi_bsf.c
index 412fba6f3..5faabdf61 100644
--- a/security/nss/lib/freebl/blapi_bsf.c
+++ b/security/nss/lib/freebl/blapi_bsf.c
@@ -313,16 +313,16 @@ loser:
void
DES_DestroyContext(DESContext *cx, PRBool freeit)
{
- PORT_Assert(cx != NULL);
- if (cx == NULL) {
- PORT_SetError(SEC_ERROR_INVALID_ARGS);
- return;
- }
- if (cx->keyobj != NULL_PTR)
- B_DestroyKeyObject(&cx->keyobj);
- if (cx->algobj != NULL_PTR)
- B_DestroyAlgorithmObject(&cx->algobj);
if (freeit) {
+ PORT_Assert(cx != NULL);
+ if (cx == NULL) {
+ PORT_SetError(SEC_ERROR_INVALID_ARGS);
+ return;
+ }
+ if (cx->keyobj != NULL_PTR)
+ B_DestroyKeyObject(&cx->keyobj);
+ if (cx->algobj != NULL_PTR)
+ B_DestroyAlgorithmObject(&cx->algobj);
PORT_ZFree(cx, sizeof(DESContext));
}
}
@@ -556,16 +556,16 @@ loser:
void
RC2_DestroyContext(RC2Context *cx, PRBool freeit)
{
- PORT_Assert(cx != NULL);
- if (cx == NULL) {
- PORT_SetError(SEC_ERROR_INVALID_ARGS);
- return;
- }
- if (cx->keyobj != NULL_PTR)
- B_DestroyKeyObject(&cx->keyobj);
- if (cx->algobj != NULL_PTR)
- B_DestroyAlgorithmObject(&cx->algobj);
if (freeit) {
+ PORT_Assert(cx != NULL);
+ if (cx == NULL) {
+ PORT_SetError(SEC_ERROR_INVALID_ARGS);
+ return;
+ }
+ if (cx->keyobj != NULL_PTR)
+ B_DestroyKeyObject(&cx->keyobj);
+ if (cx->algobj != NULL_PTR)
+ B_DestroyAlgorithmObject(&cx->algobj);
PORT_ZFree(cx, sizeof(RC2Context));
}
}
@@ -770,16 +770,16 @@ loser:
void
RC4_DestroyContext(RC4Context *cx, PRBool freeit)
{
- PORT_Assert(cx != NULL);
- if (cx == NULL) {
- PORT_SetError(SEC_ERROR_INVALID_ARGS);
- return;
- }
- if (cx->keyobj != NULL_PTR)
- B_DestroyKeyObject(&cx->keyobj);
- if (cx->algobj != NULL_PTR)
- B_DestroyAlgorithmObject(&cx->algobj);
if (freeit) {
+ PORT_Assert(cx != NULL);
+ if (cx == NULL) {
+ PORT_SetError(SEC_ERROR_INVALID_ARGS);
+ return;
+ }
+ if (cx->keyobj != NULL_PTR)
+ B_DestroyKeyObject(&cx->keyobj);
+ if (cx->algobj != NULL_PTR)
+ B_DestroyAlgorithmObject(&cx->algobj);
PORT_ZFree(cx, sizeof(RC4Context));
}
}
@@ -998,16 +998,16 @@ loser:
void RC5_DestroyContext(RC5Context *cx, PRBool freeit)
{
- PORT_Assert(cx != NULL);
- if (cx == NULL) {
- PORT_SetError(SEC_ERROR_INVALID_ARGS);
- return;
- }
- if (cx->keyobj != NULL_PTR)
- B_DestroyKeyObject(&cx->keyobj);
- if (cx->algobj != NULL_PTR)
- B_DestroyAlgorithmObject(&cx->algobj);
if (freeit) {
+ PORT_Assert(cx != NULL);
+ if (cx == NULL) {
+ PORT_SetError(SEC_ERROR_INVALID_ARGS);
+ return;
+ }
+ if (cx->keyobj != NULL_PTR)
+ B_DestroyKeyObject(&cx->keyobj);
+ if (cx->algobj != NULL_PTR)
+ B_DestroyAlgorithmObject(&cx->algobj);
PORT_ZFree(cx, sizeof(RC5Context));
}
}