]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/notlist.c
statd - the files created are named for dns_name, so use that when unlinking.
[nfs-utils.git] / utils / statd / notlist.c
index 0ef5491d0d347e1d22bb9d2c72750ca5ee8323d9..1698c26abef92166941dc39eba066b879422957c 100644 (file)
@@ -12,7 +12,9 @@
  * Simple list management for notify list
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <string.h>
 #include "misc.h"
@@ -52,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;
 }
@@ -211,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);
 }