r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
[samba.git] / source3 / libads / ldap_printer.c
index b650a5eb38bbc58521cad0e485a5e91e26a837ce..68e6735891038a1de49a390e0cc6e8abb8189605 100644 (file)
@@ -1,7 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
    ads (active directory) printer utility library
-   Copyright (C) Jim McDonough 2002
+   Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@ ADS_STATUS ads_find_printer_on_server(ADS_STRUCT *ads, void **res,
 
        status = ads_find_machine_acct(ads, res, servername);
        if (!ADS_ERR_OK(status)) {
-               DEBUG(1, ("ads_add_printer: cannot find host %s in ads\n",
+               DEBUG(1, ("ads_find_printer_on_server: cannot find host %s in ads\n",
                          servername));
                return status;
        }
@@ -161,10 +161,9 @@ static BOOL map_multi_sz(TALLOC_CTX *ctx, ADS_MODLIST *mods,
        };
 
        if (num_vals) {
-               str_values = talloc(ctx, 
-                                   (num_vals + 1) * sizeof(smb_ucs2_t *));
+               str_values = TALLOC_ARRAY(ctx, char *, num_vals + 1);
                memset(str_values, '\0', 
-                      (num_vals + 1) * sizeof(smb_ucs2_t *));
+                      (num_vals + 1) * sizeof(char *));
 
                cur_str = (smb_ucs2_t *) value->data_p;
                for (i=0; i < num_vals; i++)