summaryrefslogtreecommitdiffstats
path: root/server/db/sysdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/db/sysdb.c')
-rw-r--r--server/db/sysdb.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/db/sysdb.c b/server/db/sysdb.c
index 1268d9390..7a4731863 100644
--- a/server/db/sysdb.c
+++ b/server/db/sysdb.c
@@ -88,13 +88,12 @@ static int sysdb_attrs_get_el(struct sysdb_attrs *attrs, const char *name,
int sysdb_attrs_add_val(struct sysdb_attrs *attrs,
const char *name, const struct ldb_val *val)
{
- struct ldb_message_element *el;
+ struct ldb_message_element *el = NULL;
struct ldb_val *vals;
int ret;
ret = sysdb_attrs_get_el(attrs, name, &el);
-
vals = talloc_realloc(attrs->a, el->values,
struct ldb_val, el->num_values+1);
if (!vals) return ENOMEM;
@@ -116,7 +115,7 @@ int sysdb_attrs_add_string(struct sysdb_attrs *attrs,
{
struct ldb_val v;
- v.data = (uint8_t *)str;
+ v.data = (uint8_t *)discard_const(str);
v.length = strlen(str);
return sysdb_attrs_add_val(attrs, name, &v);