summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-14 22:41:06 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-15 08:45:01 +0200
commit06ec5d0177ac3bcd2b12f6279b23bc0a02f93bf9 (patch)
tree2195c1fbc883109648bc6c86081401256f48cb6c /source4/dsdb/common
parentd099f86a373e4e8dd11c7736ffbce177a910db9f (diff)
downloadsamba-06ec5d0177ac3bcd2b12f6279b23bc0a02f93bf9.tar.gz
samba-06ec5d0177ac3bcd2b12f6279b23bc0a02f93bf9.tar.bz2
samba-06ec5d0177ac3bcd2b12f6279b23bc0a02f93bf9.zip
s4:dsdb/common/util.c - samdb_msg_add_string - the attribute name doesn't need to be duplicated
This is done internally by the LDB library - look at "ldb_msg_add_empty".
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 18a8669f29..3dd5f78964 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -770,12 +770,11 @@ int samdb_find_or_add_attribute(struct ldb_context *ldb, struct ldb_message *msg
int samdb_msg_add_string(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
const char *attr_name, const char *str)
{
- char *s = talloc_strdup(mem_ctx, str);
- char *a = talloc_strdup(mem_ctx, attr_name);
- if (s == NULL || a == NULL) {
+ const char *s = talloc_strdup(mem_ctx, str);
+ if (s == NULL) {
return ldb_oom(sam_ldb);
}
- return ldb_msg_add_string(msg, a, s);
+ return ldb_msg_add_string(msg, attr_name, s);
}
/*