From: Andreas Schneider Date: Wed, 8 May 2019 14:32:45 +0000 (+0200) Subject: s4:ntvfs: Do not free eadb before we printed an error X-Git-Tag: tdb-1.4.1~160 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6da032df5450ef72f8608a19b3b5cc6e9185cd6e;p=thirdparty%2Fsamba.git s4:ntvfs: Do not free eadb before we printed an error Found by GCC 9. Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index df5637486d3..c69e979c31c 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -123,7 +123,6 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) pvfs, eadb, 50000, lpcfg_tdb_flags(pvfs->ntvfs->ctx->lp_ctx, TDB_DEFAULT), O_RDWR|O_CREAT, 0600); - TALLOC_FREE(eadb); if (pvfs->ea_db != NULL) { pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; } else { @@ -131,6 +130,7 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) eadb, strerror(errno))); pvfs->flags &= ~PVFS_FLAG_XATTR_ENABLE; } + TALLOC_FREE(eadb); } if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) {