X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fstatd%2Fnotlist.c;h=1698c26abef92166941dc39eba066b879422957c;hp=4f52b1deccb3c41ab6e7550baf3324bebaeb26ad;hb=6080a2854af9c12a5794a389e98f0cd4d3942a6c;hpb=ac5b03be829b4c9369ebfb07a688308721103228 diff --git a/utils/statd/notlist.c b/utils/statd/notlist.c index 4f52b1d..1698c26 100644 --- a/utils/statd/notlist.c +++ b/utils/statd/notlist.c @@ -54,15 +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))) - return NULL; + NL_MY_NAME(new) = xstrdup(my_name); + NL_MON_NAME(new) = xstrdup(mon_name); return new; } @@ -213,6 +211,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); }