diff options
author | Günther Deschner <gd@samba.org> | 2006-09-24 23:44:00 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:14:41 -0500 |
commit | 82bf0da9d33d84023338498a6fde9f9f91b173d8 (patch) | |
tree | cd96b5a5e9b2b15107a40d53220386715f7271ec /source3/libads | |
parent | 611b5d29fc820e8e1361581e26b42f436c045c2b (diff) | |
download | samba-82bf0da9d33d84023338498a6fde9f9f91b173d8.tar.gz samba-82bf0da9d33d84023338498a6fde9f9f91b173d8.tar.bz2 samba-82bf0da9d33d84023338498a6fde9f9f91b173d8.zip |
r18879: Fix crash for "net ads gpo list".
Guenther
(This used to be commit 7df5808d8b1d9458dbd47b92750c0b128325335c)
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/gpo.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/source3/libads/gpo.c b/source3/libads/gpo.c index 84898ab387..fc7f9064e8 100644 --- a/source3/libads/gpo.c +++ b/source3/libads/gpo.c @@ -380,12 +380,10 @@ ADS_STATUS ads_delete_gpo_link(ADS_STRUCT *ads, gpo->ds_path = ads_get_dn(ads, res); } if (gpo->ds_path == NULL) { - ads_msgfree(ads, res); return ADS_ERROR(LDAP_NO_MEMORY); } if (!ads_pull_uint32(ads, res, "versionNumber", &gpo->version)) { - ads_msgfree(ads, res); return ADS_ERROR(LDAP_NO_MEMORY); } @@ -395,25 +393,21 @@ ADS_STATUS ads_delete_gpo_link(ADS_STRUCT *ads, /* sure ??? */ if (!ads_pull_uint32(ads, res, "flags", &gpo->options)) { - ads_msgfree(ads, res); return ADS_ERROR(LDAP_NO_MEMORY); } gpo->file_sys_path = ads_pull_string(ads, mem_ctx, res, "gPCFileSysPath"); if (gpo->file_sys_path == NULL) { - ads_msgfree(ads, res); return ADS_ERROR(LDAP_NO_MEMORY); } gpo->display_name = ads_pull_string(ads, mem_ctx, res, "displayName"); if (gpo->display_name == NULL) { - ads_msgfree(ads, res); return ADS_ERROR(LDAP_NO_MEMORY); } gpo->name = ads_pull_string(ads, mem_ctx, res, "name"); if (gpo->name == NULL) { - ads_msgfree(ads, res); return ADS_ERROR(LDAP_NO_MEMORY); } @@ -421,8 +415,6 @@ ADS_STATUS ads_delete_gpo_link(ADS_STRUCT *ads, gpo->machine_extensions = ads_pull_string(ads, mem_ctx, res, "gPCMachineExtensionNames"); gpo->user_extensions = ads_pull_string(ads, mem_ctx, res, "gPCUserExtensionNames"); - ads_msgfree(ads, res); - return ADS_ERROR(LDAP_SUCCESS); } @@ -478,16 +470,18 @@ ADS_STATUS ads_get_gpo(ADS_STRUCT *ads, if (ads_count_replies(ads, res) != 1) { DEBUG(10,("ads_get_gpo: no result\n")); + ads_msgfree(ads, res); return ADS_ERROR(LDAP_NO_SUCH_OBJECT); } dn = ads_get_dn(ads, res); if (dn == NULL) { + ads_msgfree(ads, res); return ADS_ERROR(LDAP_NO_MEMORY); } status = ads_parse_gpo(ads, mem_ctx, res, dn, gpo); - + ads_msgfree(ads, res); ads_memfree(ads, dn); return status; |