+3226. [bug] Address minor resource leakages. [RT #26624]
+
3225. [bug] Silence spurious "setsockopt(517, IPV6_V6ONLY) failed"
messages. [RT #26507]
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dighost.c,v 1.342 2011/11/06 23:18:07 marka Exp $ */
+/* $Id: dighost.c,v 1.343 2011/11/30 00:48:51 marka Exp $ */
/*! \file
* \note
return (result);
}
-
isc_result_t
get_trusted_key(isc_mem_t *mctx)
{
if (key != NULL)
dst_key_free(&key);
}
+ fclose(fp);
return (ISC_R_SUCCESS);
}
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec-keyfromlabel.c,v 1.37 2011/10/20 21:20:01 marka Exp $ */
+/* $Id: dnssec-keyfromlabel.c,v 1.38 2011/11/30 00:48:51 marka Exp $ */
/*! \file */
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";
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);
isc_mem_free(mctx, label);
isc_mem_destroy(&mctx);
+ if (freeit != NULL)
+ free(freeit);
+
return (0);
}
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec-keygen.c,v 1.119 2011/10/20 21:20:01 marka Exp $ */
+/* $Id: dnssec-keygen.c,v 1.120 2011/11/30 00:48:51 marka Exp $ */
/*! \file */
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;
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);
isc_mem_stats(mctx, stdout);
isc_mem_destroy(&mctx);
+ if (freeit != NULL)
+ free(freeit);
+
return (0);
}
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gsstest.c,v 1.18 2011/09/05 17:39:37 each Exp $ */
+/* $Id: gsstest.c,v 1.19 2011/11/30 00:48:51 marka Exp $ */
#include <config.h>
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];
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);
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;
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);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: driver.c,v 1.8 2011/10/11 13:36:12 marka Exp $ */
+/* $Id: driver.c,v 1.9 2011/11/30 00:48:51 marka Exp $ */
/*
* This provides a very simple example of an external loadable DLZ
if (argc < 2) {
state->log(ISC_LOG_ERROR,
"dlz_example: please specify a zone name");
+ dlz_destroy(state);
return (ISC_R_FAILURE);
}
modrdataset(struct dlz_example_data *state, const char *name,
const char *rdatastr, struct record *list)
{
- char *full_name, *dclass, *type, *data, *ttlstr;
- char *buf = strdup(rdatastr);
+ char *full_name, *dclass, *type, *data, *ttlstr, *buf;
isc_result_t result;
#if defined(WIN32) || defined(_REENTRANT)
char *saveptr = NULL;
#endif
+ buf = strdup(rdatastr);
+ if (buf == NULL)
+ return (ISC_R_FAILURE);
+
/*
* The format is:
* FULLNAME\tTTL\tDCLASS\tTYPE\tDATA
full_name = STRTOK_R(buf, "\t", &saveptr);
if (full_name == NULL)
- return (ISC_R_FAILURE);
+ goto error;
ttlstr = STRTOK_R(NULL, "\t", &saveptr);
if (ttlstr == NULL)
- return (ISC_R_FAILURE);
+ goto error;
dclass = STRTOK_R(NULL, "\t", &saveptr);
if (dclass == NULL)
- return (ISC_R_FAILURE);
+ goto error;
type = STRTOK_R(NULL, "\t", &saveptr);
if (type == NULL)
- return (ISC_R_FAILURE);
+ goto error;
data = STRTOK_R(NULL, "\t", &saveptr);
if (data == NULL)
- return (ISC_R_FAILURE);
+ goto error;
result = add_name(state, list, name, type,
strtoul(ttlstr, NULL, 10), data);
free(buf);
return (result);
+
+ error:
+ free(buf);
+ return (ISC_R_FAILURE);
}
"@(#) 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.2 2011/11/30 00:48:51 marka Exp $ (LBL)";
#endif
/*
* nslint - perform consistency checks on dns files
++errors;
fprintf(stderr, "%s: %s/%s:%d bad in-addr.arpa domain\n",
prog, cwd, file, n);
+ fclose(f);
return;
}
isc_hash_destroy();
isc_entropy_detach(&ectx);
isc_mem_destroy(&mctx);
+ if (zonefile)
+ free(zonefile);
return 0;
}