diff options
author | nelsonb%netscape.com <devnull@localhost> | 2003-11-04 01:51:54 +0000 |
---|---|---|
committer | nelsonb%netscape.com <devnull@localhost> | 2003-11-04 01:51:54 +0000 |
commit | c164d6b6aa5fdff7fea15f7c1fc178427c131608 (patch) | |
tree | f09e921dccd6a1762593d7c78725702022f828aa | |
parent | 3011fd94b20fa38fc50c4e546774d0f139b9cefb (diff) | |
download | nss-hg-c164d6b6aa5fdff7fea15f7c1fc178427c131608.tar.gz |
Better cleanup. Plug leaks in pp. bug 222568. r=nicolson (this part).
-rw-r--r-- | security/nss/cmd/pp/pp.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/security/nss/cmd/pp/pp.c b/security/nss/cmd/pp/pp.c index 157dec0af..bb2de8b67 100644 --- a/security/nss/cmd/pp/pp.c +++ b/security/nss/cmd/pp/pp.c @@ -120,7 +120,7 @@ int main(int argc, char **argv) break; } } - + PL_DestroyOptState(optstate); if (!typeTag) Usage(progName); if (!inFile) inFile = PR_STDIN; @@ -167,10 +167,18 @@ int main(int argc, char **argv) return -1; } + if (inFile != PR_STDIN) + PR_Close(inFile); + PORT_Free(der.data); if (rv) { fprintf(stderr, "%s: problem converting data (%s)\n", progName, SECU_Strerror(PORT_GetError())); - return -1; } - return 0; + if (NSS_Shutdown() != SECSuccess) { + fprintf(stderr, "%s: NSS_Shutdown failed (%s)\n", + progName, SECU_Strerror(PORT_GetError())); + rv = SECFailure; + } + PR_Cleanup(); + return rv; } |