X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fstatd%2Fnotlist.c;h=0341c159167836661e2d3027279bc7e3a4a86dba;hp=0ef5491d0d347e1d22bb9d2c72750ca5ee8323d9;hb=014e00dfaea0efc92150e2aedc5ca43aa337545e;hpb=0fc49952e287c0f2387ba019b5d8e295e2411354 diff --git a/utils/statd/notlist.c b/utils/statd/notlist.c index 0ef5491..0341c15 100644 --- a/utils/statd/notlist.c +++ b/utils/statd/notlist.c @@ -12,10 +12,11 @@ * Simple list management for notify list */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif #include -#include "misc.h" #include "statd.h" #include "notlist.h" @@ -52,15 +53,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))) - return NULL; + NL_MY_NAME(new) = xstrdup(my_name); + NL_MON_NAME(new) = xstrdup(mon_name); return new; } @@ -190,7 +189,6 @@ nlist_clone(notify_list *entry) NL_MY_PROG(new) = NL_MY_PROG(entry); NL_MY_VERS(new) = NL_MY_VERS(entry); NL_MY_PROC(new) = NL_MY_PROC(entry); - NL_ADDR(new) = NL_ADDR(entry); memcpy(NL_PRIV(new), NL_PRIV(entry), SM_PRIV_SIZE); return new; @@ -211,6 +209,7 @@ nlist_free(notify_list **head, notify_list *entry) free(NL_MY_NAME(entry)); if (NL_MON_NAME(entry)) free(NL_MON_NAME(entry)); + free(entry->dns_name); free(entry); } @@ -233,7 +232,8 @@ nlist_gethost(notify_list *list, char *host, int myname) notify_list *lp; for (lp = list; lp; lp = lp->next) { - if (matchhostname(host, myname? NL_MY_NAME(lp) : NL_MON_NAME(lp))) + if (statd_matchhostname(host, + myname? NL_MY_NAME(lp) : NL_MON_NAME(lp))) return lp; }