summaryrefslogtreecommitdiff
path: root/source4/lib/registry/regf.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-22 20:10:26 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-22 22:31:05 +0100
commitdc17292f1a097d3abd8c391315b661034ab1914e (patch)
tree06d2d052cc955005c3387095adbef42db819e293 /source4/lib/registry/regf.c
parent9c3e6249fd984b823a77cab0514601d2a487920a (diff)
downloadsamba-dc17292f1a097d3abd8c391315b661034ab1914e.tar.gz
samba-dc17292f1a097d3abd8c391315b661034ab1914e.tar.bz2
samba-dc17292f1a097d3abd8c391315b661034ab1914e.zip
s4:registry - add more "W_ERROR_HAVE_NO_MEMORY" invocations (on talloc'ed stuff)
Diffstat (limited to 'source4/lib/registry/regf.c')
-rw-r--r--source4/lib/registry/regf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c
index 52adb3ae98..5825ac18a8 100644
--- a/source4/lib/registry/regf.c
+++ b/source4/lib/registry/regf.c
@@ -455,6 +455,7 @@ static WERROR regf_get_info(TALLOC_CTX *mem_ctx,
*classname = talloc_strndup(mem_ctx,
(char*)data.data,
private_data->nk->clsname_length);
+ W_ERROR_HAVE_NO_MEMORY(*classname);
} else
*classname = NULL;
}
@@ -540,8 +541,10 @@ static WERROR regf_get_value(TALLOC_CTX *ctx, struct hive_key *key,
}
/* FIXME: name character set ?*/
- if (name != NULL)
+ if (name != NULL) {
*name = talloc_strndup(ctx, vk->data_name, vk->name_length);
+ W_ERROR_HAVE_NO_MEMORY(*name);
+ }
if (data_type != NULL)
*data_type = vk->data_type;
@@ -549,6 +552,7 @@ static WERROR regf_get_value(TALLOC_CTX *ctx, struct hive_key *key,
if (vk->data_length & 0x80000000) {
vk->data_length &=~0x80000000;
data->data = (uint8_t *)talloc_memdup(ctx, (uint8_t *)&vk->data_offset, vk->data_length);
+ W_ERROR_HAVE_NO_MEMORY(data->data);
data->length = vk->data_length;
} else {
*data = hbin_get(regf, vk->data_offset);
@@ -773,6 +777,7 @@ static WERROR regf_get_subkey_by_index(TALLOC_CTX *ctx,
*classname = talloc_strndup(ctx,
(char*)db.data,
ret->nk->clsname_length);
+ W_ERROR_HAVE_NO_MEMORY(*classname);
} else
*classname = NULL;
}