Do initialise allocated file system args structures for puffs and nfs

(fix some puffs tests failures with MALLOC_OPTIONS=J).
While here, detect and report args allocation failure.

ok from pooka.
This commit is contained in:
njoly 2011-02-10 16:35:01 +00:00
parent 22c822c7f3
commit 96506c0e2a
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fstest_nfs.c,v 1.5 2010/12/31 18:11:27 pooka Exp $ */
/* $NetBSD: fstest_nfs.c,v 1.6 2011/02/10 16:35:01 njoly Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -149,6 +149,9 @@ donewfs(const atf_tc_t *tc, void **argp,
* the mountpath available here.
*/
args = malloc(sizeof(*args));
if (args == NULL)
return errno;
memset(args, 0, sizeof(*args));
args->ta_childpid = childpid;
strcpy(args->ta_ethername, ethername);

View File

@ -1,4 +1,4 @@
/* $NetBSD: fstest_puffs.c,v 1.9 2011/01/07 11:50:37 pooka Exp $ */
/* $NetBSD: fstest_puffs.c,v 1.10 2011/02/10 16:35:01 njoly Exp $ */
/*
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@ -260,6 +260,7 @@ donewfs(const atf_tc_t *tc, void **argp,
args = malloc(sizeof(*args));
if (args == NULL)
return errno;
memset(args, 0, sizeof(*args));
pflags = &args->pta_pflags;