From: Noel Power Date: Wed, 22 May 2019 14:07:44 +0000 (+0000) Subject: s3/modules: cppcheck: Fix ctunullpointer error X-Git-Tag: ldb-2.0.5~500 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52cf237b1d4a2f1d6f5541f3cdbcced95ff6f5ff;p=thirdparty%2Fsamba.git s3/modules: cppcheck: Fix ctunullpointer error Fixes source3/modules/vfs_syncops.c:117: error: ctunullpointer: Null pointer dereference: smb_fname <--[cppcheck] Signed-off-by: Noel Power Reviewed-by: Andreas Schneider --- diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c index f94588c60ed..0a51fdf6e7a 100644 --- a/source3/modules/vfs_syncops.c +++ b/source3/modules/vfs_syncops.c @@ -113,11 +113,13 @@ static void syncops_two_names(const char *name1, const char *name2) */ static void syncops_smb_fname(const struct smb_filename *smb_fname) { - char *parent; - parent = parent_dir(NULL, smb_fname->base_name); - if (parent) { - syncops_sync_directory(parent); - talloc_free(parent); + char *parent = NULL; + if (smb_fname != NULL) { + parent = parent_dir(NULL, smb_fname->base_name); + if (parent != NULL) { + syncops_sync_directory(parent); + talloc_free(parent); + } } }