dsdb: Fix CID 1435453 Null pointer dereferences
authorVolker Lendecke <vl@samba.org>
Tue, 8 May 2018 06:35:18 +0000 (08:35 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 8 May 2018 08:03:16 +0000 (10:03 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/dsdb/samdb/ldb_modules/schema_load.c

index fd19d1051621186bed7c5a049619179c412b8eaf..6a3001d05e4adc9d33bd963605452c1d306bba6a 100644 (file)
@@ -82,6 +82,10 @@ static int schema_metadata_open(struct ldb_module *module)
        filename = ldb_relative_path(ldb,
                                     tmp_ctx,
                                     "sam.ldb.d/metadata.tdb");
+       if (filename == NULL) {
+               talloc_free(tmp_ctx);
+               return ldb_module_oom(module);
+       }
 
        open_flags = O_RDWR;
        if (stat(filename, &statbuf) != 0) {