From 9dab25c12483f7a684686bdb0f82bc523b6b0e82 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 24 Jan 2016 18:50:56 +0100 Subject: [PATCH] server: Avoid invalid memory access if creation of namespace fails in create_directory (Coverity). Signed-off-by: Sebastian Lackner Signed-off-by: Alexandre Julliard --- server/directory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/directory.c b/server/directory.c index de049ef7d09..937ab895b5e 100644 --- a/server/directory.c +++ b/server/directory.c @@ -192,7 +192,7 @@ static struct directory *create_directory( struct directory *root, const struct if (!(dir->entries = create_namespace( hash_size ))) { release_object( dir ); - dir = NULL; + return NULL; } if (sd) default_set_sd( &dir->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION );