diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-03-19 19:14:44 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-03-21 14:03:55 +0100 |
commit | a55031792dfd56e1d8f235ea6cdd6383507ee5e4 (patch) | |
tree | 307e7c7856ee93925a94be56688f70aaae8efe7c | |
parent | 1d49a266abbe6ae0bf50f456399099a31814b9a9 (diff) | |
download | samba-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.
-rw-r--r-- | source4/lib/registry/ldb.c | 4 |
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); } |