#include <string.h>
#include <signal.h>
#include <sys/types.h>
+#ifndef G_OS_WIN32
#include <sys/wait.h>
+#endif
#include "send_message.h"
#include "session.h"
argv = strsplit_with_quote(command, " ", 0);
if (g_spawn_async_with_pipes(NULL, argv, NULL,
- G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
+#ifdef G_OS_WIN32
+ 0,
+#else
+ G_SPAWN_DO_NOT_REAP_CHILD,
+#endif
+ NULL, NULL,
&pid, &child_stdin, NULL, NULL,
NULL) == FALSE) {
g_snprintf(buf, sizeof(buf),
fd_close(child_stdin);
+#ifndef G_OS_WIN32
waitpid(pid, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
err = TRUE;
+#endif
g_spawn_close_pid(pid);
input_dialog_query_password
(ac_prefs->smtp_server,
smtp_session->user);
- if (!smtp_session->pass)
- smtp_session->pass = g_strdup("");
+ if (!smtp_session->pass) {
+ session_destroy(session);
+ return -1;
+ }
ac_prefs->tmp_smtp_pass =
g_strdup(smtp_session->pass);
}
input_dialog_query_password
(ac_prefs->smtp_server,
smtp_session->user);
- if (!smtp_session->pass)
- smtp_session->pass = g_strdup("");
+ if (!smtp_session->pass) {
+ session_destroy(session);
+ return -1;
+ }
ac_prefs->tmp_pass =
g_strdup(smtp_session->pass);
}
_("Con_tinue connecting"),
GTK_STOCK_CANCEL, NULL,
FALSE, NULL, ALERT_WARNING,
- G_ALERTALTERNATE) != G_ALERTDEFAULT)
+ G_ALERTALTERNATE) != G_ALERTDEFAULT) {
+ session_destroy(session);
return -1;
+ }
}
port = ac_prefs->set_smtpport ? ac_prefs->smtpport : SMTP_PORT;
#endif
if (ac_prefs->smtp_userid && ac_prefs->tmp_smtp_pass) {
g_free(ac_prefs->tmp_smtp_pass);
ac_prefs->tmp_smtp_pass = NULL;
+ } else if (ac_prefs->tmp_pass) {
+ g_free(ac_prefs->tmp_pass);
+ ac_prefs->tmp_pass = NULL;
}
ret = -1;
} else if (SMTP_SESSION(session)->state == SMTP_MAIL_SENT_OK) {