diff options
Diffstat (limited to 'contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c')
-rw-r--r-- | contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c b/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c index 1323ed7186919..6a07146763821 100644 --- a/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c +++ b/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssec-keyfromlabel.c,v 1.32.14.2 2011-03-12 04:59:14 tbox Exp $ */ +/* $Id: dnssec-keyfromlabel.c,v 1.32.14.4 2011/11/30 00:51:38 marka Exp $ */ /*! \file */ @@ -110,7 +110,8 @@ usage(void) { int main(int argc, char **argv) { - char *algname = NULL, *nametype = NULL, *type = NULL; + char *algname = NULL, *freeit = NULL; + char *nametype = NULL, *type = NULL; const char *directory = NULL; #ifdef USE_PKCS11 const char *engine = "pkcs11"; @@ -342,6 +343,9 @@ main(int argc, char **argv) { algname = strdup(DEFAULT_NSEC3_ALGORITHM); else algname = strdup(DEFAULT_ALGORITHM); + if (algname == NULL) + fatal("strdup failed"); + freeit = algname; if (verbose > 0) fprintf(stderr, "no algorithm specified; " "defaulting to %s\n", algname); @@ -514,8 +518,7 @@ main(int argc, char **argv) { * is a risk of ID collision due to this key or another key * being revoked. */ - if (key_collision(dst_key_id(key), name, directory, alg, mctx, &exact)) - { + if (key_collision(key, name, directory, mctx, &exact)) { isc_buffer_clear(&buf); ret = dst_key_buildfilename(key, 0, directory, &buf); if (ret != ISC_R_SUCCESS) @@ -560,5 +563,8 @@ main(int argc, char **argv) { isc_mem_free(mctx, label); isc_mem_destroy(&mctx); + if (freeit != NULL) + free(freeit); + return (0); } |