diff options
author | vinit jain <vinit.j@samsung.com> | 2015-05-28 18:40:37 -0700 |
---|---|---|
committer | vinit jain <vinit.j@samsung.com> | 2015-05-28 18:40:37 -0700 |
commit | 9e38c5b3040e28713d643be524c78027bc128af9 (patch) | |
tree | 57a4920b1fd96408f2acdd894d26af9fdf4b4678 | |
parent | 5c23e62d477c79ed23ec622c9fecf9845cff0d08 (diff) | |
download | nss-hg-9e38c5b3040e28713d643be524c78027bc128af9.tar.gz |
Bug 1167043: Fix memory leaks of 'certPrefix' and 'srcCertPrefix' in
certutil_main. r=wtc.
-rw-r--r-- | cmd/certutil/certutil.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/certutil/certutil.c b/cmd/certutil/certutil.c index 49ebf5811..0d56cd4b4 100644 --- a/cmd/certutil/certutil.c +++ b/cmd/certutil/certutil.c @@ -2421,9 +2421,9 @@ certutil_main(int argc, char **argv, PRBool initialize) SECItem certReqDER = { siBuffer, NULL, 0 }; SECItem certDER = { siBuffer, NULL, 0 }; const char *slotname = "internal"; - char * certPrefix = ""; + const char *certPrefix = ""; char * sourceDir = ""; - char * srcCertPrefix = ""; + const char *srcCertPrefix = ""; char * upgradeID = ""; char * upgradeTokenName = ""; KeyType keytype = rsaKey; @@ -2594,7 +2594,7 @@ certutil_main(int argc, char **argv, PRBool initialize) /* -P certdb name prefix */ if (certutil.options[opt_DBPrefix].activated) { if (certutil.options[opt_DBPrefix].arg) { - certPrefix = strdup(certutil.options[opt_DBPrefix].arg); + certPrefix = certutil.options[opt_DBPrefix].arg; } else { Usage(progName); } @@ -2603,7 +2603,7 @@ certutil_main(int argc, char **argv, PRBool initialize) /* --source-prefix certdb name prefix */ if (certutil.options[opt_SourcePrefix].activated) { if (certutil.options[opt_SourcePrefix].arg) { - srcCertPrefix = strdup(certutil.options[opt_SourcePrefix].arg); + srcCertPrefix = certutil.options[opt_SourcePrefix].arg; } else { Usage(progName); } |