diff --git a/bin/dnssec/dnssec-keygen.c b/bin/dnssec/dnssec-keygen.c index d71226720e..affb064f49 100644 --- a/bin/dnssec/dnssec-keygen.c +++ b/bin/dnssec/dnssec-keygen.c @@ -29,7 +29,7 @@ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssec-keygen.c,v 1.92 2009/09/02 23:48:01 tbox Exp $ */ +/* $Id: dnssec-keygen.c,v 1.93 2009/09/04 16:57:22 each Exp $ */ /*! \file */ @@ -704,7 +704,8 @@ main(int argc, char **argv) { * case we return failure. */ ret = dst_key_fromfile(name, dst_key_id(key), alg, - DST_TYPE_PRIVATE, NULL, mctx, &oldkey); + DST_TYPE_PRIVATE, directory, + mctx, &oldkey); /* do not overwrite an existing key */ if (ret == ISC_R_SUCCESS) { dst_key_free(&oldkey); @@ -715,7 +716,8 @@ main(int argc, char **argv) { if (conflict == ISC_TRUE) { if (verbose > 0) { isc_buffer_clear(&buf); - ret = dst_key_buildfilename(key, 0, NULL, &buf); + ret = dst_key_buildfilename(key, 0, directory, + &buf); fprintf(stderr, "%s: %s already exists, " "generating a new key\n", diff --git a/bin/dnssec/dnssec-revoke.c b/bin/dnssec/dnssec-revoke.c index 634fc71128..4a86d74f9a 100644 --- a/bin/dnssec/dnssec-revoke.c +++ b/bin/dnssec/dnssec-revoke.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssec-revoke.c,v 1.10 2009/09/02 23:48:01 tbox Exp $ */ +/* $Id: dnssec-revoke.c,v 1.11 2009/09/04 16:57:22 each Exp $ */ /*! \file */ @@ -96,7 +96,15 @@ main(int argc, char **argv) { force = ISC_TRUE; break; case 'K': - dir = isc_commandline_argument; + /* + * We don't have to copy it here, but do it to + * simplify cleanup later + */ + dir = isc_mem_strdup(mctx, isc_commandline_argument); + if (dir == NULL) { + fatal("Failed to allocate memory for " + "directory"); + } break; case 'r': remove = ISC_TRUE; diff --git a/bin/dnssec/dnssec-settime.c b/bin/dnssec/dnssec-settime.c index 90e374769a..10e972d125 100644 --- a/bin/dnssec/dnssec-settime.c +++ b/bin/dnssec/dnssec-settime.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssec-settime.c,v 1.10 2009/09/02 23:48:01 tbox Exp $ */ +/* $Id: dnssec-settime.c,v 1.11 2009/09/04 16:57:22 each Exp $ */ /*! \file */ @@ -203,7 +203,7 @@ main(int argc, char **argv) { directory = isc_mem_strdup(mctx, isc_commandline_argument); if (directory == NULL) { - fatal("Failed to memory allocation for " + fatal("Failed to allocate memory for " "directory"); } break;