]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r4306: Couple more MALLOC fixes from albert chin (china@thewrittenword.com).
authorJeremy Allison <jra@samba.org>
Tue, 21 Dec 2004 07:08:11 +0000 (07:08 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:43 +0000 (10:53 -0500)
Jeremy.

source/lib/util_smbd.c
source/printing/print_svid.c

index 58e7d9c6275d1fb40a551cf02f1d2e4eade789e5..586362c1e4cfe147fd46df2fc877548ba78f878b 100644 (file)
@@ -45,7 +45,7 @@ BOOL getgroups_user(const char *user, gid_t primary_gid, gid_t **ret_groups, int
        int i;
 
        max_grp = groups_max();
-       temp_groups = SMB_MALLOC_P(gid_t, max_grp);
+       temp_groups = SMB_MALLOC_ARRAY(gid_t, max_grp);
        if (! temp_groups) {
                return False;
        }
index c7a8c9413d53e601bb5ea1fb8ce8d05ff17c87e1..d9db500425e5c1fe6ef67450d7930e531558d710 100644 (file)
@@ -88,7 +88,7 @@ static void populate_printers(void)
                        *tmp = '\0';
                
                /* add it to the cache */
-               if ((ptmp = malloc(sizeof (*ptmp))) != NULL) {
+               if ((ptmp = SMB_MALLOC_P(printer_t)) != NULL) {
                        ZERO_STRUCTP(ptmp);
                        if((ptmp->name = SMB_STRDUP(name)) == NULL)
                                DEBUG(0,("populate_printers: malloc fail in strdup !\n"));