From: Andreas Schneider Date: Wed, 8 May 2019 15:05:58 +0000 (+0200) Subject: s3:winbindd: Do not free db_path in idmap_tdb2 before we printed it X-Git-Tag: tdb-1.4.1~155 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e333425e0ff6be5691b74a920610b508e7d26892;p=thirdparty%2Fsamba.git s3:winbindd: Do not free db_path in idmap_tdb2 before we printed it Found by GCC 9. Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c index 3ae309e5e5b..b784546bb33 100644 --- a/source3/winbindd/idmap_tdb2.c +++ b/source3/winbindd/idmap_tdb2.c @@ -115,13 +115,13 @@ static NTSTATUS idmap_tdb2_open_db(struct idmap_domain *dom) /* Open idmap repository */ ctx->db = db_open(ctx, db_path, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE); - TALLOC_FREE(db_path); - if (ctx->db == NULL) { DEBUG(0, ("Unable to open idmap_tdb2 database '%s'\n", db_path)); + TALLOC_FREE(db_path); return NT_STATUS_UNSUCCESSFUL; } + TALLOC_FREE(db_path); return idmap_tdb2_init_hwm(dom); }