mirror of
https://github.com/samba-team/samba.git
synced 2025-08-08 13:49:29 +03:00
r2601: avoid free()ing unallocated memory by mistake
(This used to be commit e502b276ae
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
df99e4bb37
commit
567ed4e718
@ -135,7 +135,12 @@ int x_fclose(XFILE *f)
|
||||
memset(f->buf, 0, f->bufsize);
|
||||
SAFE_FREE(f->buf);
|
||||
}
|
||||
SAFE_FREE(f);
|
||||
/* check the file descriptor given to the function is NOT one of the static
|
||||
* descriptor of this libreary or we will free unallocated memory
|
||||
* --sss */
|
||||
if (f != x_stdin && f != x_stdout && f != x_stderr) {
|
||||
SAFE_FREE(f);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user