From f419c2b0911788cdd0474bd543ebdbfa52954889 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 19 Jan 2011 23:07:33 +0100 Subject: s3-utils: Fixed possible resource leak in net_usershare. s3-utils: Fixed possible resource leak in net_usershare. --- source3/utils/net_usershare.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3') diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c index 61b2caa606..f0ee682aee 100644 --- a/source3/utils/net_usershare.c +++ b/source3/utils/net_usershare.c @@ -907,6 +907,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) _("net usershare add: cannot lstat tmp file %s\n"), full_path_tmp ); TALLOC_FREE(ctx); + close(tmpfd); return -1; } @@ -916,6 +917,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) _("net usershare add: cannot fstat tmp file %s\n"), full_path_tmp ); TALLOC_FREE(ctx); + close(tmpfd); return -1; } @@ -925,6 +927,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) "file ?\n"), full_path_tmp ); TALLOC_FREE(ctx); + close(tmpfd); return -1; } @@ -934,6 +937,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) "to 0644n"), full_path_tmp ); TALLOC_FREE(ctx); + close(tmpfd); return -1; } @@ -957,6 +961,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) (unsigned int)to_write, full_path_tmp, strerror(errno)); unlink(full_path_tmp); TALLOC_FREE(ctx); + close(tmpfd); return -1; } -- cgit