summaryrefslogtreecommitdiffstats
path: root/utils/statd/notlist.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-06-23 17:10:56 +1000
committerNeil Brown <neilb@suse.de>2006-06-23 17:10:56 +1000
commit0523fd513c6baa8dbf45d1a7afea2044262aeb3d (patch)
tree124eade50a8f75cbb2bb8688aff958367a0f4b90 /utils/statd/notlist.c
parent2e075a16da4963f54cd556403ca9e15a68de27fd (diff)
downloadnfs-utils-0523fd513c6baa8dbf45d1a7afea2044262aeb3d.tar.gz
nfs-utils-0523fd513c6baa8dbf45d1a7afea2044262aeb3d.tar.xz
nfs-utils-0523fd513c6baa8dbf45d1a7afea2044262aeb3d.zip
Further coverity related cleanups.
Greg Banks suggested some variations, particularly improved use of xmalloc/xstrdup functions. Thanks.
Diffstat (limited to 'utils/statd/notlist.c')
-rw-r--r--utils/statd/notlist.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/utils/statd/notlist.c b/utils/statd/notlist.c
index 98aa6e2..b74d9df 100644
--- a/utils/statd/notlist.c
+++ b/utils/statd/notlist.c
@@ -54,19 +54,13 @@ nlist_new(char *my_name, char *mon_name, int state)
{
notify_list *new;
- if (!(new = (notify_list *) xmalloc(sizeof(notify_list))))
- return NULL;
+ new = (notify_list *) xmalloc(sizeof(notify_list));
memset(new, 0, sizeof(*new));
NL_TIMES(new) = MAX_TRIES;
NL_STATE(new) = state;
- if (!(NL_MY_NAME(new) = xstrdup(my_name))
- || !(NL_MON_NAME(new) = xstrdup(mon_name))) {
- if (NL_MY_NAME(new))
- free(NL_MY_NAME(new));
- free(new);
- return NULL;
- }
+ NL_MY_NAME(new) = xstrdup(my_name);
+ NL_MON_NAME(new) = xstrdup(mon_name);
return new;
}