diff options
-rw-r--r-- | source3/utils/regedit.c | 4 | ||||
-rw-r--r-- | source3/utils/regedit.h | 3 | ||||
-rw-r--r-- | source3/utils/regedit_samba3.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/source3/utils/regedit.c b/source3/utils/regedit.c index 21fd257e41..a1118d5633 100644 --- a/source3/utils/regedit.c +++ b/source3/utils/regedit.c @@ -197,7 +197,7 @@ static void load_values(struct regedit *regedit) static void add_reg_key(struct regedit *regedit, struct tree_node *node, bool subkey) { - char *name; + const char *name; const char *msg; if (!subkey && !node->parent) { @@ -244,7 +244,7 @@ static void add_reg_key(struct regedit *regedit, struct tree_node *node, dialog_notice(regedit, DIA_ALERT, "New Key", "Failed to create key."); } - talloc_free(name); + talloc_free(discard_const(name)); } } diff --git a/source3/utils/regedit.h b/source3/utils/regedit.h index fb9ad6100d..2ab40f9d69 100644 --- a/source3/utils/regedit.h +++ b/source3/utils/regedit.h @@ -33,7 +33,8 @@ WERROR reg_openhive_wrap(TALLOC_CTX *ctx, const char *hive, WERROR reg_openkey_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *parent, const char *name, struct samba3_registry_key *key); WERROR reg_enumvalue_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *key, - uint32 idx, char **name, uint32_t *type, DATA_BLOB *data); + uint32 idx, char **name, uint32_t *type, + DATA_BLOB *data); WERROR reg_queryvalue_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *key, const char *name, uint32_t *type, DATA_BLOB *data); WERROR reg_enumkey_wrap(TALLOC_CTX *ctx, struct samba3_registry_key *key, diff --git a/source3/utils/regedit_samba3.c b/source3/utils/regedit_samba3.c index 39b06bca1c..4e22be8fde 100644 --- a/source3/utils/regedit_samba3.c +++ b/source3/utils/regedit_samba3.c @@ -107,7 +107,7 @@ static WERROR samba3_get_value_by_index(TALLOC_CTX *mem_ctx, mykeydata = talloc_get_type(parent, struct samba3_key); return reg_enumvalue_wrap(mem_ctx, &mykeydata->s3key, n, - value_name, type, data); + discard_const(value_name), type, data); } static WERROR samba3_get_value_by_name(TALLOC_CTX *mem_ctx, @@ -138,7 +138,7 @@ static WERROR samba3_get_subkey_by_index(TALLOC_CTX *mem_ctx, *keyclass = NULL; return reg_enumkey_wrap(mem_ctx, &mykeydata->s3key, n, - name, last_changed_time); + discard_const(name), last_changed_time); } static WERROR samba3_add_key(TALLOC_CTX *mem_ctx, |