summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-10-12 08:11:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:42 -0500
commitdc3e65b25295f68d0c7c5d3a7cc9bade638661f4 (patch)
tree3752fe1513d288c234f24c74ebf3c35585e3e45d /source4/lib/ldb/modules
parent35720734911169acde6bf9f2c9a1f83336744f6f (diff)
downloadsamba-dc3e65b25295f68d0c7c5d3a7cc9bade638661f4.tar.gz
samba-dc3e65b25295f68d0c7c5d3a7cc9bade638661f4.tar.bz2
samba-dc3e65b25295f68d0c7c5d3a7cc9bade638661f4.zip
r10917: copy the element name in a ldb_msg_rename_attr() and ldb_msg_copy_attr() to ensure
that callers (like the ldap server) can talloc_steal the name (This used to be commit 9c914542cc346758c82f89990c80eb096a9c0959)
Diffstat (limited to 'source4/lib/ldb/modules')
-rw-r--r--source4/lib/ldb/modules/operational.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/lib/ldb/modules/operational.c b/source4/lib/ldb/modules/operational.c
index d1e83c02e0..09f9a9e62c 100644
--- a/source4/lib/ldb/modules/operational.c
+++ b/source4/lib/ldb/modules/operational.c
@@ -113,6 +113,8 @@ static int operational_search_bytree(struct ldb_module *module,
int ret;
const char **search_attrs = NULL;
+ (*res) = NULL;
+
/* replace any attributes in the parse tree that are
searchable, but are stored using a different name in the
backend */
@@ -165,9 +167,11 @@ static int operational_search_bytree(struct ldb_module *module,
goto oom;
}
} else {
- ldb_msg_rename_attr((*res)[r],
- search_sub[i].replace,
- search_sub[i].attr);
+ if (ldb_msg_rename_attr((*res)[r],
+ search_sub[i].replace,
+ search_sub[i].attr) != 0) {
+ goto oom;
+ }
}
}
}
@@ -179,6 +183,7 @@ static int operational_search_bytree(struct ldb_module *module,
oom:
talloc_free(search_attrs);
+ talloc_free(*res);
ldb_oom(module->ldb);
return -1;
}