summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/util_reg_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/util_reg_api.c b/source3/lib/util_reg_api.c
index 423fdfd3be..8668bd8817 100644
--- a/source3/lib/util_reg_api.c
+++ b/source3/lib/util_reg_api.c
@@ -51,7 +51,6 @@ WERROR registry_pull_value(TALLOC_CTX *mem_ctx,
*/
smb_ucs2_t *tmp;
- uint32 num_ucs2 = length / 2;
if (length == 1) {
/* win2k regedit gives us a string of 1 byte when
@@ -71,6 +70,7 @@ WERROR registry_pull_value(TALLOC_CTX *mem_ctx,
goto error;
}
else {
+ uint32 num_ucs2 = length / 2;
if (!(tmp = SMB_MALLOC_ARRAY(smb_ucs2_t, num_ucs2+1))) {
err = WERR_NOMEM;
goto error;