From 479e643d54f14914b70a33598b83f0f6ca1f2164 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 11 Oct 2000 21:19:01 +0000 Subject: [PATCH] use isc_mem_allocate for omapi_data_strdup to be consistant with isc_mem_strdup --- lib/omapi/data.c | 4 ++-- lib/omapi/protocol.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/omapi/data.c b/lib/omapi/data.c index cf634e47d3..f6c697e095 100644 --- a/lib/omapi/data.c +++ b/lib/omapi/data.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: data.c,v 1.17 2000/08/01 01:32:50 tale Exp $ */ +/* $Id: data.c,v 1.18 2000/10/11 21:19:00 marka Exp $ */ /* Principal Author: Ted Lemon */ @@ -204,7 +204,7 @@ omapi_data_strdup(isc_mem_t *mctx, omapi_data_t *t) { REQUIRE(t->type == omapi_datatype_string || t->type == omapi_datatype_data); - s = isc_mem_get(mctx, t->u.buffer.len + 1); + s = isc_mem_allocate(mctx, t->u.buffer.len + 1); if (s != NULL) { memcpy(s, t->u.buffer.value, t->u.buffer.len); s[t->u.buffer.len] = '\0'; diff --git a/lib/omapi/protocol.c b/lib/omapi/protocol.c index e632939f48..b0b5700fe4 100644 --- a/lib/omapi/protocol.c +++ b/lib/omapi/protocol.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: protocol.c,v 1.31 2000/08/01 01:32:58 tale Exp $ */ +/* $Id: protocol.c,v 1.32 2000/10/11 21:19:01 marka Exp $ */ /* * Functions supporting the object management protocol. @@ -566,7 +566,8 @@ dispatch_messages(omapi_protocol_t *protocol, break; omapi_string_dereference(&protocol->name); - omapi_data_dereference(&protocol->value); + if (protocol->value != NULL) + omapi_data_dereference(&protocol->value); goto need_name_length; @@ -746,8 +747,7 @@ protocol_setvalue(omapi_object_t *h, omapi_string_t *name, omapi_data_t *value) if (result != ISC_R_SUCCESS) { if (p->key != NULL) dst_key_free(&p->key); - isc_mem_put(omapi_mctx, p->authname, - strlen(p->authname) + 1); + isc_mem_free(omapi_mctx, p->authname); p->authname = NULL; p->algorithm = 0; p->key = NULL; @@ -781,7 +781,7 @@ protocol_destroy(omapi_object_t *h) { OBJECT_DEREF(&p->authinfo); if (p->authname != NULL) { - isc_mem_put(omapi_mctx, p->authname, strlen(p->authname) + 1); + isc_mem_free(omapi_mctx, p->authname); p->authname = NULL; }