summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/registry/util.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c
index 3c1289956d..b389ea4698 100644
--- a/source4/lib/registry/util.c
+++ b/source4/lib/registry/util.c
@@ -146,24 +146,26 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx,
break;
case REG_SZ:
case REG_EXPAND_SZ:
- convert_string_talloc_convenience(mem_ctx,
- iconv_convenience,
- CH_UNIX, CH_UTF16,
- data_str,
- strlen(data_str)+1,
- (void **)&data->data,
- &data->length, false);
+ return convert_string_talloc_convenience(mem_ctx,
+ iconv_convenience,
+ CH_UNIX, CH_UTF16,
+ data_str,
+ strlen(data_str)+1,
+ (void **)&data->data,
+ &data->length, false);
break;
case REG_DWORD:
case REG_DWORD_BIG_ENDIAN: {
uint32_t tmp = strtol(data_str, NULL, 0);
*data = data_blob_talloc(mem_ctx, NULL, sizeof(uint32_t));
+ if (data->data == NULL) return false;
SIVAL(data->data, 0, tmp);
}
break;
case REG_QWORD: {
uint64_t tmp = strtoll(data_str, NULL, 0);
*data = data_blob_talloc(mem_ctx, NULL, sizeof(uint64_t));
+ if (data->data == NULL) return false;
SBVAL(data->data, 0, tmp);
}
break;