2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

remove unnecessary allocations

This commit is contained in:
Brian Wellington
2000-09-12 11:50:46 +00:00
parent 356fdd6073
commit c0bf51978c
3 changed files with 5 additions and 19 deletions

View File

@@ -17,7 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dnssec-keygen.c,v 1.39 2000/09/12 10:07:46 bwelling Exp $ */ /* $Id: dnssec-keygen.c,v 1.40 2000/09/12 11:50:44 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -171,8 +171,6 @@ main(int argc, char **argv) {
break; break;
case 'r': case 'r':
randomfile = isc_commandline_argument; randomfile = isc_commandline_argument;
if (randomfile == NULL)
fatal("out of memory");
break; break;
case 'v': case 'v':
endp = NULL; endp = NULL;
@@ -191,8 +189,6 @@ main(int argc, char **argv) {
} }
setup_entropy(mctx, randomfile, &ectx); setup_entropy(mctx, randomfile, &ectx);
if (randomfile != NULL)
isc_mem_free(mctx, randomfile);
ret = dst_lib_init(mctx, ectx, ret = dst_lib_init(mctx, ectx,
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY); ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
if (ret != ISC_R_SUCCESS) if (ret != ISC_R_SUCCESS)

View File

@@ -17,7 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dnssec-makekeyset.c,v 1.39 2000/09/12 10:07:47 bwelling Exp $ */ /* $Id: dnssec-makekeyset.c,v 1.40 2000/09/12 11:50:45 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -144,10 +144,7 @@ main(int argc, char *argv[]) {
break; break;
case 'r': case 'r':
randomfile = isc_mem_strdup(mctx, randomfile = isc_commandline_argument;
isc_commandline_argument);
if (randomfile == NULL)
fatal("out of memory");
break; break;
case 'v': case 'v':
@@ -175,8 +172,6 @@ main(int argc, char *argv[]) {
usage(); usage();
setup_entropy(mctx, randomfile, &ectx); setup_entropy(mctx, randomfile, &ectx);
if (randomfile != NULL)
isc_mem_free(mctx, randomfile);
eflags = ISC_ENTROPY_BLOCKING; eflags = ISC_ENTROPY_BLOCKING;
if (!pseudorandom) if (!pseudorandom)
eflags |= ISC_ENTROPY_GOODONLY; eflags |= ISC_ENTROPY_GOODONLY;

View File

@@ -17,7 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dnssec-signkey.c,v 1.35 2000/09/12 10:07:48 bwelling Exp $ */ /* $Id: dnssec-signkey.c,v 1.36 2000/09/12 11:50:46 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -195,10 +195,7 @@ main(int argc, char *argv[]) {
break; break;
case 'r': case 'r':
randomfile = isc_mem_strdup(mctx, randomfile = isc_commandline_argument;
isc_commandline_argument);
if (randomfile == NULL)
fatal("out of memory");
break; break;
case 'v': case 'v':
@@ -231,8 +228,6 @@ main(int argc, char *argv[]) {
rdclass = dns_rdataclass_in; rdclass = dns_rdataclass_in;
setup_entropy(mctx, randomfile, &ectx); setup_entropy(mctx, randomfile, &ectx);
if (randomfile != NULL)
isc_mem_free(mctx, randomfile);
eflags = ISC_ENTROPY_BLOCKING; eflags = ISC_ENTROPY_BLOCKING;
if (!pseudorandom) if (!pseudorandom)
eflags |= ISC_ENTROPY_GOODONLY; eflags |= ISC_ENTROPY_GOODONLY;