diff options
author | Jeremy Allison <jra@samba.org> | 2007-04-30 02:51:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:49 -0500 |
commit | 56a5d05b8b285250bdc0e9cc3c8f3c3d8af80382 (patch) | |
tree | fe800dc017985b616874b79ffad6122a1e5bde34 /source3/libgpo | |
parent | be8b0685a55700c6bce3681734800ec6434b0364 (diff) | |
download | samba-56a5d05b8b285250bdc0e9cc3c8f3c3d8af80382.tar.gz samba-56a5d05b8b285250bdc0e9cc3c8f3c3d8af80382.tar.bz2 samba-56a5d05b8b285250bdc0e9cc3c8f3c3d8af80382.zip |
r22590: Make TALLOC_ARRAY consistent across all uses.
That should be it....
Jeremy.
(This used to be commit 603233a98bbf65467c8b4f04719d771c70b3b4c9)
Diffstat (limited to 'source3/libgpo')
-rw-r--r-- | source3/libgpo/gpo_ldap.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/source3/libgpo/gpo_ldap.c b/source3/libgpo/gpo_ldap.c index 13ec80f2ad..6c1079832d 100644 --- a/source3/libgpo/gpo_ldap.c +++ b/source3/libgpo/gpo_ldap.c @@ -47,12 +47,17 @@ ADS_STATUS ads_parse_gp_ext(TALLOC_CTX *mem_ctx, gp_ext->num_exts = i; - gp_ext->extensions = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_ext->num_exts); - gp_ext->extensions_guid = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_ext->num_exts); - gp_ext->snapins = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_ext->num_exts); - gp_ext->snapins_guid = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_ext->num_exts); - - gp_ext->gp_extension = talloc_strdup(mem_ctx, extension_raw); + if (gp_ext->num_exts) { + gp_ext->extensions = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_ext->num_exts); + gp_ext->extensions_guid = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_ext->num_exts); + gp_ext->snapins = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_ext->num_exts); + gp_ext->snapins_guid = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_ext->num_exts); + } else { + gp_ext->extensions = NULL; + gp_ext->extensions_guid = NULL; + gp_ext->snapins = NULL; + gp_ext->snapins_guid = NULL; + } if (gp_ext->extensions == NULL || gp_ext->extensions_guid == NULL || gp_ext->snapins == NULL || gp_ext->snapins_guid == NULL || @@ -60,6 +65,8 @@ ADS_STATUS ads_parse_gp_ext(TALLOC_CTX *mem_ctx, goto parse_error; } + gp_ext->gp_extension = talloc_strdup(mem_ctx, extension_raw); + for (i = 0; ext_list[i] != NULL; i++) { int k; @@ -161,8 +168,13 @@ ADS_STATUS ads_parse_gplink(TALLOC_CTX *mem_ctx, gp_link->gp_opts = options; gp_link->num_links = i; - gp_link->link_names = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_link->num_links); - gp_link->link_opts = TALLOC_ZERO_ARRAY(mem_ctx, uint32, gp_link->num_links); + if (gp_link->num_links) { + gp_link->link_names = TALLOC_ZERO_ARRAY(mem_ctx, char *, gp_link->num_links); + gp_link->link_opts = TALLOC_ZERO_ARRAY(mem_ctx, uint32, gp_link->num_links); + } else { + gp_link->link_names = NULL; + gp_link->link_opts = NULL; + } gp_link->gp_link = talloc_strdup(mem_ctx, gp_link_raw); |