From c5a8bf3335606c070e1c74f339ea4c22d0adfa57 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Dec 2004 07:08:11 +0000 Subject: [PATCH] r4306: Couple more MALLOC fixes from albert chin (china@thewrittenword.com). Jeremy. --- source/lib/util_smbd.c | 2 +- source/printing/print_svid.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/lib/util_smbd.c b/source/lib/util_smbd.c index 58e7d9c6275..586362c1e4c 100644 --- a/source/lib/util_smbd.c +++ b/source/lib/util_smbd.c @@ -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; } diff --git a/source/printing/print_svid.c b/source/printing/print_svid.c index c7a8c9413d5..d9db500425e 100644 --- a/source/printing/print_svid.c +++ b/source/printing/print_svid.c @@ -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")); -- 2.47.3