52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
|
Index: security/nss/cmd/fipstest/fipstest.c
|
||
|
===================================================================
|
||
|
RCS file: /cvsroot/mozilla/security/nss/cmd/fipstest/fipstest.c,v
|
||
|
retrieving revision 1.3.2.21
|
||
|
diff -u -p -r1.3.2.21 fipstest.c
|
||
|
--- security/nss/cmd/fipstest/fipstest.c 25 Mar 2006 23:47:58 -0000 1.3.2.21
|
||
|
+++ security/nss/cmd/fipstest/fipstest.c 28 Jul 2006 05:09:07 -0000
|
||
|
@@ -2916,8 +2916,8 @@ void sha_test(char *reqfn)
|
||
|
unsigned char seed[HASH_LENGTH_MAX]; /* max size of seed 64 bytes */
|
||
|
unsigned char MD[HASH_LENGTH_MAX]; /* message digest */
|
||
|
|
||
|
- FILE *req; /* input stream from the REQUEST file */
|
||
|
- FILE *resp; /* output stream to the RESPONSE file */
|
||
|
+ FILE *req = NULL; /* input stream from the REQUEST file */
|
||
|
+ FILE *resp; /* output stream to the RESPONSE file */
|
||
|
|
||
|
buf = PORT_ZAlloc(bufSize);
|
||
|
if (buf == NULL) {
|
||
|
@@ -3013,7 +3013,9 @@ void sha_test(char *reqfn)
|
||
|
}
|
||
|
}
|
||
|
loser:
|
||
|
- fclose(req);
|
||
|
+ if (req) {
|
||
|
+ fclose(req);
|
||
|
+ }
|
||
|
if (buf) {
|
||
|
PORT_ZFree(buf, bufSize);
|
||
|
}
|
||
|
@@ -3088,8 +3090,8 @@ void hmac_test(char *reqfn)
|
||
|
unsigned char HMAC[HASH_LENGTH_MAX]; /* computed HMAC */
|
||
|
HASH_HashType hash_alg; /* HMAC type */
|
||
|
|
||
|
- FILE *req; /* input stream from the REQUEST file */
|
||
|
- FILE *resp; /* output stream to the RESPONSE file */
|
||
|
+ FILE *req = NULL; /* input stream from the REQUEST file */
|
||
|
+ FILE *resp; /* output stream to the RESPONSE file */
|
||
|
|
||
|
buf = PORT_ZAlloc(bufSize);
|
||
|
if (buf == NULL) {
|
||
|
@@ -3201,7 +3203,9 @@ void hmac_test(char *reqfn)
|
||
|
}
|
||
|
}
|
||
|
loser:
|
||
|
- fclose(req);
|
||
|
+ if (req) {
|
||
|
+ fclose(req);
|
||
|
+ }
|
||
|
if (buf) {
|
||
|
PORT_ZFree(buf, bufSize);
|
||
|
}
|