Commit 5504e5d0 authored by Brian Wellington's avatar Brian Wellington
Browse files

A few isc_mem_strdup() failures weren't handled well.

parent 5a11763a
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: confkeys.c,v 1.27 2000/08/01 01:23:21 tale Exp $ */
/* $Id: confkeys.c,v 1.28 2000/10/19 01:38:25 bwelling Exp $ */
#include <config.h>
......@@ -244,6 +244,7 @@ dns_c_kdef_new(isc_mem_t *mem, const char *name, dns_c_kdef_t **keyid)
kd->keyid = isc_mem_strdup(mem, name);
if (kd->keyid == NULL) {
isc_mem_put(mem, kd, sizeof *kd);
return (ISC_R_NOMEMORY);
}
kd->magic = DNS_C_KDEF_MAGIC;
......@@ -600,6 +601,10 @@ dns_c_kid_new(isc_mem_t *mem, const char *name, dns_c_kid_t **keyid)
ki->magic = DNS_C_KEYID_MAGIC;
ki->mem = mem;
ki->keyid = isc_mem_strdup(mem, name);
if (ki->keyid == NULL) {
isc_mem_put(mem, ki, sizeof *ki);
return (ISC_R_NOMEMORY);
}
ISC_LINK_INIT(ki, next);
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: conflwres.c,v 1.4 2000/10/19 01:26:36 gson Exp $ */
/* $Id: conflwres.c,v 1.5 2000/10/19 01:38:26 bwelling Exp $ */
#include <config.h>
......@@ -394,6 +394,10 @@ dns_c_search_new(isc_mem_t *mem, const char *val, dns_c_search_t **search)
ki->magic = DNS_C_SEARCH_MAGIC;
ki->mem = mem;
ki->search = isc_mem_strdup(mem, val);
if (ki->search == NULL) {
isc_mem_put(mem, ki, sizeof *ki);
return (ISC_R_NOMEMORY);
}
ISC_LINK_INIT(ki, next);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment