summaryrefslogtreecommitdiff
path: root/lib/ldb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2017-06-09 14:07:40 +1200
committerGarming Sam <garming@samba.org>2017-06-15 01:24:25 +0200
commitd8f3034c163831c5143d95fd803b8c765bf5767f (patch)
tree089de92cc25152f66e309cf3df12b30d3e87b429 /lib/ldb
parent1ff09f0f82a97e2950b9fddc15a3cf58fef3bc23 (diff)
downloadsamba-d8f3034c163831c5143d95fd803b8c765bf5767f.tar.gz
ldb_tdb: Check for memory allocation failure in ltdb_index_transaction_start()
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'lib/ldb')
-rw-r--r--lib/ldb/ldb_tdb/ldb_index.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c
index 721ec1c9a6a..e1e54ba38db 100644
--- a/lib/ldb/ldb_tdb/ldb_index.c
+++ b/lib/ldb/ldb_tdb/ldb_index.c
@@ -54,6 +54,10 @@ int ltdb_index_transaction_start(struct ldb_module *module)
{
struct ltdb_private *ltdb = talloc_get_type(ldb_module_get_private(module), struct ltdb_private);
ltdb->idxptr = talloc_zero(ltdb, struct ltdb_idxptr);
+ if (ltdb->idxptr == NULL) {
+ return ldb_oom(ldb_module_get_ctx(module));
+ }
+
return LDB_SUCCESS;
}