mirror of
https://github.com/samba-team/samba.git
synced 2024-12-28 07:21:54 +03:00
r14020: Coverity bug CID #66. Missing free on error exit.
Jeremy.
(This used to be commit b9980bddf5
)
This commit is contained in:
parent
f635dcb5f3
commit
43ad653211
@ -96,13 +96,16 @@ XFILE *x_fopen(const char *fname, int flags, mode_t mode)
|
||||
XFILE *ret;
|
||||
|
||||
ret = SMB_MALLOC_P(XFILE);
|
||||
if (!ret) return NULL;
|
||||
if (!ret) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(ret, 0, sizeof(XFILE));
|
||||
|
||||
if ((flags & O_ACCMODE) == O_RDWR) {
|
||||
/* we don't support RDWR in XFILE - use file
|
||||
descriptors instead */
|
||||
SAFE_FREE(ret);
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user