* utils/mountd/auth.c (auth_authenticate_internal): Call
xstrdup for hostname before passing it to gethostbyname.
* utils/mountd/mountd.c (get_exportlist): Use xstrdup instead
of strdup.
+Mon Jan 10 14:26:33 2000 H.J. Lu <hjl@lucon.org>
+
+ * utils/mountd/auth.c (auth_authenticate_internal): Call
+ xstrdup for hostname before passing it to gethostbyname.
+
+ * utils/mountd/mountd.c (get_exportlist): Use xstrdup instead
+ of strdup.
+
Sun Dec 19 09:35:01 1999 H.J. Lu <hjl@lucon.org>
* README: Update the mailing list address.
#include "nfslib.h"
#include "exportfs.h"
#include "mountd.h"
+#include "xmalloc.h"
enum auth_error
{
else {
/* must make sure the hostent is authorative. */
char **sp;
- struct hostent *forward;
+ struct hostent *forward = NULL;
+ char *tmpname;
- forward = gethostbyname((*hpp)->h_name);
+ tmpname = xstrdup((*hpp)->h_name);
+ if (tmpname) {
+ forward = gethostbyname(tmpname);
+ free(tmpname);
+ }
if (forward) {
/* now make sure the "addr" is in the list */
for (sp = forward->h_addr_list ; *sp ; sp++) {
e = (struct exportnode *) xmalloc(sizeof(*e));
e->ex_next = elist;
e->ex_groups = NULL;
- e->ex_dir = strdup(exp->m_export.m_path);
+ e->ex_dir = xstrdup(exp->m_export.m_path);
elist = e;
}