summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-19 19:14:44 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-21 14:03:55 +0100
commita55031792dfd56e1d8f235ea6cdd6383507ee5e4 (patch)
tree307e7c7856ee93925a94be56688f70aaae8efe7c /source4
parent1d49a266abbe6ae0bf50f456399099a31814b9a9 (diff)
downloadsamba-a55031792dfd56e1d8f235ea6cdd6383507ee5e4.tar.gz
samba-a55031792dfd56e1d8f235ea6cdd6383507ee5e4.tar.bz2
samba-a55031792dfd56e1d8f235ea6cdd6383507ee5e4.zip
s4:registry - "LDB backend" - fix up memory allocation for dynamic integers
We don't need to reserve memory for NULL termination when storing data as integers.
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/ldb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 62c55fa9af..4dff5e3987 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -89,7 +89,7 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx,
if (val->data[0] != '\0') {
/* The data is a plain DWORD */
uint32_t tmp = strtoul((char *)val->data, NULL, 0);
- data->data = talloc_size(mem_ctx, sizeof(uint32_t) + 1);
+ data->data = talloc_size(mem_ctx, sizeof(uint32_t));
if (data->data != NULL) {
SIVAL(data->data, 0, tmp);
}
@@ -116,7 +116,7 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx,
if (val->data[0] != '\0') {
/* The data is a plain QWORD */
uint64_t tmp = strtoull((char *)val->data, NULL, 0);
- data->data = talloc_size(mem_ctx, sizeof(uint64_t) + 1);
+ data->data = talloc_size(mem_ctx, sizeof(uint64_t));
if (data->data != NULL) {
SBVAL(data->data, 0, tmp);
}