summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/xfile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/lib/xfile.c b/source3/lib/xfile.c
index 5bb93179af..71f8bdbcbb 100644
--- a/source3/lib/xfile.c
+++ b/source3/lib/xfile.c
@@ -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;
}