summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/kanji.h24
-rw-r--r--source3/nmbd/nmbd_nameregister.c6
2 files changed, 28 insertions, 2 deletions
diff --git a/source3/include/kanji.h b/source3/include/kanji.h
index 528680d88a..5e8173ee14 100644
--- a/source3/include/kanji.h
+++ b/source3/include/kanji.h
@@ -108,6 +108,30 @@
extern char *(*_dos_to_unix)(char *str, BOOL overwrite);
extern char *(*_unix_to_dos)(char *str, BOOL overwrite);
+/*
+ * The following is needed for AIX systems that have
+ * their own #defines for strchr, strrchr, strstr
+ * and strtok.
+ */
+
+#ifdef strchr
+#undef strchr
+#endif /* strchr */
+
+#ifdef strrchr
+#undef strrchr
+#endif /* strrchr */
+
+#ifdef strstr
+#undef strstr
+#endif /* strstr */
+
+#ifdef strtok
+#undef strtok
+#endif /* strtok */
+
+/* Ensure we use our definitions. */
+
#define strchr sj_strchr
#define strrchr sj_strrchr
#define strstr sj_strstr
diff --git a/source3/nmbd/nmbd_nameregister.c b/source3/nmbd/nmbd_nameregister.c
index 603daaa531..cdaef1a767 100644
--- a/source3/nmbd/nmbd_nameregister.c
+++ b/source3/nmbd/nmbd_nameregister.c
@@ -283,8 +283,6 @@ static BOOL multihomed_register_name( struct nmb_name *nmbname, uint16 nb_flags,
add_name_to_subnet(unicast_subnet, nmbname->name, nmbname->name_type,
nb_flags, lp_max_ttl(), SELF_NAME, num_ips, ip_list);
- free((char *)ip_list);
-
/* Now try and register the name, num_ips times. On the last time use
the given success and fail functions. */
@@ -302,10 +300,14 @@ static BOOL multihomed_register_name( struct nmb_name *nmbname, uint16 nb_flags,
{
DEBUG(0,("multihomed_register_name: Failed to send packet trying to \
register name %s IP %s\n", namestr(nmbname), inet_ntoa(ip_list[i]) ));
+
+ free((char *)ip_list);
return True;
}
}
+ free((char *)ip_list);
+
return False;
}