diff options
-rw-r--r-- | src/proto.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/proto.c b/src/proto.c index ee949dd6..1ab8d187 100644 --- a/src/proto.c +++ b/src/proto.c @@ -908,6 +908,7 @@ guestfs___send_file (guestfs_h *g, const char *filename) if (err < 0) { if (err == -2) /* daemon sent cancellation */ send_file_cancellation (g); + close (fd); return err; } } @@ -915,6 +916,7 @@ guestfs___send_file (guestfs_h *g, const char *filename) if (r == -1) { perrorf (g, "read: %s", filename); send_file_cancellation (g); + close (fd); return -1; } @@ -922,6 +924,7 @@ guestfs___send_file (guestfs_h *g, const char *filename) error (g, _("operation cancelled by user")); g->last_errnum = EINTR; send_file_cancellation (g); + close (fd); return -1; } |