diff options
author | Andrew Bartlett <abartlet@samba.org> | 2017-06-09 14:07:40 +1200 |
---|---|---|
committer | Garming Sam <garming@samba.org> | 2017-06-15 01:24:25 +0200 |
commit | d8f3034c163831c5143d95fd803b8c765bf5767f (patch) | |
tree | 089de92cc25152f66e309cf3df12b30d3e87b429 /lib/ldb | |
parent | 1ff09f0f82a97e2950b9fddc15a3cf58fef3bc23 (diff) | |
download | samba-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.c | 4 |
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; } |