summaryrefslogtreecommitdiffstats
path: root/source3/lib/xfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/xfile.c')
-rw-r--r--source3/lib/xfile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/xfile.c b/source3/lib/xfile.c
index 8a6776b5f91..503e8c8359b 100644
--- a/source3/lib/xfile.c
+++ b/source3/lib/xfile.c
@@ -267,7 +267,9 @@ int x_fflush(XFILE *f)
f->bufused -= ret;
if (f->bufused > 0) {
f->flags |= X_FLAG_ERROR;
- memmove(f->buf, ret + (char *)f->buf, f->bufused);
+ if (f->buf) {
+ memmove(f->buf, ret + (char *)f->buf, f->bufused);
+ }
return -1;
}