Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3d3c9278
Commit
3d3c9278
authored
Nov 17, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Nov 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Avoid leaking file descriptor on error in create_file_for_fd.
parent
609d43e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
file.c
server/file.c
+14
-10
No files found.
server/file.c
View file @
3d3c9278
...
...
@@ -120,21 +120,25 @@ struct file *create_file_for_fd( int fd, unsigned int access, unsigned int shari
if
(
fstat
(
fd
,
&
st
)
==
-
1
)
{
file_set_error
();
close
(
fd
);
return
NULL
;
}
if
((
file
=
alloc_object
(
&
file_ops
)))
if
(
!
(
file
=
alloc_object
(
&
file_ops
)))
{
file
->
mode
=
st
.
st_mode
;
file
->
access
=
default_fd_map_access
(
&
file
->
obj
,
access
);
if
(
!
(
file
->
fd
=
create_anonymous_fd
(
&
file_fd_ops
,
fd
,
&
file
->
obj
,
FILE_SYNCHRONOUS_IO_NONALERT
)))
{
release_object
(
file
);
return
NULL
;
}
allow_fd_caching
(
file
->
fd
);
close
(
fd
);
return
NULL
;
}
file
->
mode
=
st
.
st_mode
;
file
->
access
=
default_fd_map_access
(
&
file
->
obj
,
access
);
if
(
!
(
file
->
fd
=
create_anonymous_fd
(
&
file_fd_ops
,
fd
,
&
file
->
obj
,
FILE_SYNCHRONOUS_IO_NONALERT
)))
{
release_object
(
file
);
return
NULL
;
}
allow_fd_caching
(
file
->
fd
);
return
file
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment