]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/export/export.c
libexport.a: Allow client_init() to fail instead of exit
[nfs-utils.git] / support / export / export.c
index ddc8a8482e58b9a33186c454b44b9c528dfbe041..3e4da699091110645362457b3d2f3e264949233e 100644 (file)
@@ -129,6 +129,10 @@ export_dup(nfs_export *exp, struct hostent *hp)
        if (exp->m_export.e_hostname)
                new->m_export.e_hostname = xstrdup(exp->m_export.e_hostname);
        clp = client_dup(exp->m_client, hp);
        if (exp->m_export.e_hostname)
                new->m_export.e_hostname = xstrdup(exp->m_export.e_hostname);
        clp = client_dup(exp->m_client, hp);
+       if (clp == NULL) {
+               export_free(new);
+               return NULL;
+       }
        clp->m_count++;
        new->m_client = clp;
        new->m_mayexport = exp->m_mayexport;
        clp->m_count++;
        new->m_client = clp;
        new->m_mayexport = exp->m_mayexport;