From 34ad9756d73bc4203281ab39ff68489aab1b44e9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 20 Feb 2013 08:58:02 +0100 Subject: s4-client: Don't leak resource handle. Reviewed-by: Alexander Bokovoy --- source4/client/client.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/client') 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)) { -- cgit