]> diplodocus.org Git - nmh/blobdiff - sbr/addrsbr.c
Implement OAuth 2.0 [1] for XOAUTH2 in SMTP [2] and POP3 [3].
[nmh] / sbr / addrsbr.c
index b2079bd288e4f7aa28f0ab4de481bf9829d0fb2d..23a7cb4cbbd4d27adbfbcda813993cf3a36a126f 100644 (file)
@@ -11,6 +11,7 @@
 #include <h/addrsbr.h>
 #include <h/mf.h>
 #include <h/mts.h>
+#include <h/utils.h>
 
 /* High level parsing of addresses:
 
@@ -138,7 +139,7 @@ getm (char *str, char *dfhost, int dftype, char *eresult, size_t eresultsize)
        dftype = LOCALHOST;
     }
 
-    mp = (struct mailname *) calloc ((size_t) 1, sizeof(*mp));
+    mp = (struct mailname *) mh_xcalloc ((size_t) 1, sizeof(*mp));
     if (mp == NULL) {
        if (eresult) {
            strncpy (eresult, "insufficient memory to represent address",
@@ -436,7 +437,7 @@ local_test: ;
 
        if (mp->m_nohost)
            return 1;
-       if (np->m_host == NULL)
+       if (np->m_host == NULL || mp->m_host == NULL)
            continue;
        if ((len = strlen (cp = np->m_host))
                < (i = strlen (pp = mp->m_host)))