3226. [bug] Address minor resource leakages. [RT #26624]

This commit is contained in:
Mark Andrews
2011-11-30 00:54:50 +00:00
parent 4a98325b40
commit 0509c5ce27
7 changed files with 27 additions and 16 deletions
+2
View File
@@ -1,3 +1,5 @@
3226. [bug] Address minor resource leakages. [RT #26624]
--- 9.6-ESV-R6b1 released ---
3221. [bug] Fixed a potential coredump on shutdown due to
+2 -2
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.311.70.23 2011/11/06 23:45:15 tbox Exp $ */
/* $Id: dighost.c,v 1.311.70.24 2011/11/30 00:54:47 marka Exp $ */
/*! \file
* \note
@@ -4028,7 +4028,6 @@ opentmpkey(isc_mem_t *mctx, const char *file, char **tempp, FILE **fp) {
return (result);
}
isc_result_t
get_trusted_key(isc_mem_t *mctx)
{
@@ -4090,6 +4089,7 @@ get_trusted_key(isc_mem_t *mctx)
if (key != NULL)
dst_key_free(&key);
}
fclose(fp);
return (ISC_R_SUCCESS);
}
+4 -1
View File
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dnssec-keyfromlabel.c,v 1.4.50.6 2011/08/31 03:09:22 marka Exp $ */
/* $Id: dnssec-keyfromlabel.c,v 1.4.50.7 2011/11/30 00:54:47 marka Exp $ */
/*! \file */
@@ -329,5 +329,8 @@ main(int argc, char **argv) {
isc_mem_stats(mctx, stdout);
isc_mem_destroy(&mctx);
if (freeit != NULL)
free(freeit);
return (0);
}
+6 -2
View File
@@ -29,7 +29,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dnssec-keygen.c,v 1.81.48.5 2011/08/30 12:23:14 marka Exp $ */
/* $Id: dnssec-keygen.c,v 1.81.48.6 2011/11/30 00:54:47 marka Exp $ */
/*! \file */
@@ -127,7 +127,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;
char *classname = NULL;
char *endp;
dst_key_t *key = NULL, *oldkey;
@@ -555,5 +556,8 @@ main(int argc, char **argv) {
isc_mem_stats(mctx, stdout);
isc_mem_destroy(&mctx);
if (freeit != NULL)
free(freeit);
return (0);
}
+9 -10
View File
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: gsstest.c,v 1.6.332.4 2011/09/05 17:39:12 each Exp $ */
/* $Id: gsstest.c,v 1.6.332.5 2011/11/30 00:54:49 marka Exp $ */
#include <config.h>
@@ -133,7 +133,7 @@ static void
recvresponse(isc_task_t *task, isc_event_t *event) {
dns_requestevent_t *reqev = (dns_requestevent_t *)event;
isc_result_t result, result2;
dns_message_t *query, *response = NULL;
dns_message_t *query = NULL, *response = NULL;
isc_buffer_t outtoken;
isc_buffer_t outbuf;
char output[10 * 1024];
@@ -170,14 +170,14 @@ recvresponse(isc_task_t *task, isc_event_t *event) {
CHECK("dns_request_getresponse", result2);
if (response)
if (response != NULL)
dns_message_destroy(&response);
end:
if (query)
if (query != NULL)
dns_message_destroy(&query);
if (reqev->request)
if (reqev->request != NULL)
dns_request_destroy(&reqev->request);
isc_event_free(&event);
@@ -268,7 +268,7 @@ static void
initctx2(isc_task_t *task, isc_event_t *event) {
dns_requestevent_t *reqev = (dns_requestevent_t *)event;
isc_result_t result;
dns_message_t *query, *response = NULL;
dns_message_t *query = NULL, *response = NULL;
isc_buffer_t outtoken;
unsigned char array[DNS_NAME_MAXTEXT + 1];
dns_rdataset_t *rdataset;
@@ -327,14 +327,13 @@ initctx2(isc_task_t *task, isc_event_t *event) {
tsigkey = NULL;
}
if (response)
dns_message_destroy(&response);
dns_message_destroy(&response);
end:
if (query)
if (query != NULL)
dns_message_destroy(&query);
if (reqev->request)
if (reqev->request != NULL)
dns_request_destroy(&reqev->request);
isc_event_free(&event);
+2 -1
View File
@@ -23,7 +23,7 @@ static const char copyright[] =
"@(#) Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001\n\
The Regents of the University of California. All rights reserved.\n";
static const char rcsid[] =
"@(#) $Id: nslint.c,v 1.1 2001/12/21 04:12:04 marka Exp $ (LBL)";
"@(#) $Id: nslint.c,v 1.1.1688.1 2011/11/30 00:54:50 marka Exp $ (LBL)";
#endif
/*
* nslint - perform consistency checks on dns files
@@ -1059,6 +1059,7 @@ process(register const char *file, register const char *domain,
++errors;
fprintf(stderr, "%s: %s/%s:%d bad in-addr.arpa domain\n",
prog, cwd, file, n);
fclose(f);
return;
}
+2
View File
@@ -328,6 +328,8 @@ main (int *argc, char **argv)
isc_hash_destroy();
isc_entropy_detach(&ectx);
isc_mem_destroy(&mctx);
if (zonefile)
free(zonefile);
return 0;
}