diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c index fcc7718ecb..c359649edb 100644 --- a/tools/libxc/xc_domain_save.c +++ b/tools/libxc/xc_domain_save.c @@ -2040,7 +2040,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter } /* Flush last write and discard cache for file. */ - if ( outbuf_flush(xch, ob, io_fd) < 0 ) { + if ( ob && outbuf_flush(xch, ob, io_fd) < 0 ) { PERROR("Error when flushing output buffer"); rc = 1; }