summaryrefslogtreecommitdiff
path: root/source3/torture/nsstest.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-05-07 06:59:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:49 -0500
commit55739e9f860a2a8f27a99fc2f79905a8ed143fee (patch)
tree814befcf2b106109cc180b6dbd475291da3ecd18 /source3/torture/nsstest.c
parentbce78238fb84c201a9bdc6ee88a6ced38ee26768 (diff)
downloadsamba-55739e9f860a2a8f27a99fc2f79905a8ed143fee.tar.gz
samba-55739e9f860a2a8f27a99fc2f79905a8ed143fee.tar.bz2
samba-55739e9f860a2a8f27a99fc2f79905a8ed143fee.zip
r6640: Attempt to fix 'make everything' with the paranoid malloc checker.
Volker (This used to be commit 3db2799822da3711b47b60ba13daa07205ced45f)
Diffstat (limited to 'source3/torture/nsstest.c')
-rw-r--r--source3/torture/nsstest.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/torture/nsstest.c b/source3/torture/nsstest.c
index a803cd7e71..585a592bdc 100644
--- a/source3/torture/nsstest.c
+++ b/source3/torture/nsstest.c
@@ -167,13 +167,13 @@ static struct group *nss_getgrent(void)
return NULL;
if (!buf)
- buf = malloc(buflen);
+ buf = SMB_MALLOC(buflen);
again:
status = _nss_getgrent_r(&grp, buf, buflen, &nss_errno);
if (status == NSS_STATUS_TRYAGAIN) {
buflen *= 2;
- buf = realloc(buf, buflen);
+ buf = SMB_REALLOC(buf, buflen);
goto again;
}
if (status == NSS_STATUS_NOTFOUND) {
@@ -199,12 +199,12 @@ static struct group *nss_getgrnam(const char *name)
return NULL;
if (!buf)
- buf = malloc(buflen);
+ buf = SMB_MALLOC(buflen);
again:
status = _nss_getgrnam_r(name, &grp, buf, buflen, &nss_errno);
if (status == NSS_STATUS_TRYAGAIN) {
buflen *= 2;
- buf = realloc(buf, buflen);
+ buf = SMB_REALLOC(buf, buflen);
goto again;
}
if (status == NSS_STATUS_NOTFOUND) {
@@ -230,13 +230,13 @@ static struct group *nss_getgrgid(gid_t gid)
return NULL;
if (!buf)
- buf = malloc(buflen);
+ buf = SMB_MALLOC(buflen);
again:
status = _nss_getgrgid_r(gid, &grp, buf, buflen, &nss_errno);
if (status == NSS_STATUS_TRYAGAIN) {
buflen *= 2;
- buf = realloc(buf, buflen);
+ buf = SMB_REALLOC(buf, buflen);
goto again;
}
if (status == NSS_STATUS_NOTFOUND) {
@@ -333,7 +333,7 @@ static void nss_test_initgroups(char *name, gid_t gid)
int i;
NSS_STATUS status;
- groups = (gid_t *)malloc(size * sizeof(gid_t));
+ groups = SMB_MALLOC_ARRAY(gid_t, size);
groups[0] = gid;
status = nss_initgroups(name, gid, &groups, &start, &size);