From ca18f1580bae3a4e5b93f257871769c7d78a0613 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 20 Apr 2002 21:07:24 +0000 Subject: [PATCH] Clear mapping->shared_file on error. --- server/mapping.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/mapping.c b/server/mapping.c index 2d872f1e1c1..04eba65f85d 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -159,7 +159,7 @@ static int build_shared_mapping( struct mapping *mapping, int fd, /* create a temp file for the mapping */ - if (!(mapping->shared_file = create_temp_file( GENERIC_READ|GENERIC_WRITE ))) goto error; + if (!(mapping->shared_file = create_temp_file( GENERIC_READ|GENERIC_WRITE ))) return 0; if (!grow_file( mapping->shared_file, 0, total_size )) goto error; if ((shared_fd = get_mmap_fd( mapping->shared_file )) == -1) goto error; @@ -189,6 +189,8 @@ static int build_shared_mapping( struct mapping *mapping, int fd, return 1; error: + release_object( mapping->shared_file ); + mapping->shared_file = NULL; if (buffer) free( buffer ); return 0; }