From a55031792dfd56e1d8f235ea6cdd6383507ee5e4 Mon Sep 17 00:00:00 2001
From: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Date: Fri, 19 Mar 2010 19:14:44 +0100
Subject: 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.
---
 source4/lib/registry/ldb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'source4/lib/registry')

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);
 				}
-- 
cgit