summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/client/client.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index 9985338477..1dc5b6dd01 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -1130,6 +1130,7 @@ static int do_put(struct smbclient_context *ctx, char *rname, char *lname, bool
if (f && reput) {
if (x_tseek(f, start, SEEK_SET) == -1) {
d_printf("Error seeking local file\n");
+ x_fclose(f);
return 1;
}
}
@@ -1147,6 +1148,7 @@ static int do_put(struct smbclient_context *ctx, char *rname, char *lname, bool
buf = (uint8_t *)malloc(maxwrite);
if (!buf) {
d_printf("ERROR: Not enough memory!\n");
+ x_fclose(f);
return 1;
}
while (!x_feof(f)) {