mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 08:10:03 +01:00
Merge branch 'bugfix/Fopen-avoid-closing-null-fd' into 'master'
os: avoid closing null fd at Fopen See merge request xorg/xserver!2115
This commit is contained in:
commit
4abf37a25c
1 changed files with 3 additions and 1 deletions
|
|
@ -1215,7 +1215,9 @@ Fopen(const char *file, const char *type)
|
||||||
iop = fopen(file, type);
|
iop = fopen(file, type);
|
||||||
|
|
||||||
if (seteuid(euid) == -1) {
|
if (seteuid(euid) == -1) {
|
||||||
fclose(iop);
|
if (iop) {
|
||||||
|
fclose(iop);
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return iop;
|
return iop;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue