From 06ec5d0177ac3bcd2b12f6279b23bc0a02f93bf9 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 14 Oct 2010 22:41:06 +0200 Subject: 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". --- source4/dsdb/common/util.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source4/dsdb/common') 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); } /* -- cgit