summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-01-19 23:07:33 +0100
committerJeremy Allison <jra@samba.org>2011-01-26 14:20:37 -0800
commitf419c2b0911788cdd0474bd543ebdbfa52954889 (patch)
treeb50dc126b7f1672e4876dd97390b05e75c104dc4
parentde4ef101c165cf735938f914f7da620daea91762 (diff)
downloadsamba-f419c2b0911788cdd0474bd543ebdbfa52954889.tar.gz
samba-f419c2b0911788cdd0474bd543ebdbfa52954889.tar.bz2
samba-f419c2b0911788cdd0474bd543ebdbfa52954889.zip
s3-utils: Fixed possible resource leak in net_usershare.
s3-utils: Fixed possible resource leak in net_usershare.
-rw-r--r--source3/utils/net_usershare.c5
1 files changed, 5 insertions, 0 deletions
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;
}