summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-11-01 10:59:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:40 -0500
commit25fb86570d24ac22e5d69447a610e87f8584f83d (patch)
tree9ff72cecf83c794642533748646c13336fec5e10 /source3/utils
parent8a9c4331a30ad6fd012d291e2e3e935a13cb5cd6 (diff)
downloadsamba-25fb86570d24ac22e5d69447a610e87f8584f83d.tar.gz
samba-25fb86570d24ac22e5d69447a610e87f8584f83d.tar.bz2
samba-25fb86570d24ac22e5d69447a610e87f8584f83d.zip
r19525: Fix the same error in "net ads group delete".
Guenther (This used to be commit 94ed3e9de8671d677451d2a16977caeeb7e744d1)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_ads.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index a4ed3d50ea..b425ecf7c2 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -701,7 +701,7 @@ static int ads_group_delete(int argc, const char **argv)
{
ADS_STRUCT *ads;
ADS_STATUS rc;
- LDAPMessage *res;
+ LDAPMessage *res = NULL;
char *groupdn;
if (argc < 1) {
@@ -713,8 +713,9 @@ static int ads_group_delete(int argc, const char **argv)
}
rc = ads_find_user_acct(ads, &res, argv[0]);
- if (!ADS_ERR_OK(rc)) {
+ if (!ADS_ERR_OK(rc) || ads_count_replies(ads, res) != 1) {
d_printf("Group %s does not exist.\n", argv[0]);
+ ads_msgfree(ads, res);
ads_destroy(&ads);
return -1;
}
@@ -722,7 +723,7 @@ static int ads_group_delete(int argc, const char **argv)
ads_msgfree(ads, res);
rc = ads_del_dn(ads, groupdn);
ads_memfree(ads, groupdn);
- if (!ADS_ERR_OK(rc)) {
+ if (ADS_ERR_OK(rc)) {
d_printf("Group %s deleted\n", argv[0]);
ads_destroy(&ads);
return 0;