summaryrefslogtreecommitdiff
path: root/libproto/mailer/smtp_carrier.c
diff options
context:
space:
mode:
Diffstat (limited to 'libproto/mailer/smtp_carrier.c')
-rw-r--r--libproto/mailer/smtp_carrier.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libproto/mailer/smtp_carrier.c b/libproto/mailer/smtp_carrier.c
index ce9900bc3..0413cd059 100644
--- a/libproto/mailer/smtp_carrier.c
+++ b/libproto/mailer/smtp_carrier.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 2010-2019 Free Software Foundation, Inc.
+ Copyright (C) 2010-2024 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -37,10 +37,13 @@ mu_smtp_set_carrier (mu_smtp_t smtp, mu_stream_t carrier)
mu_smtp_disconnect (smtp);
mu_stream_destroy (&smtp->carrier);
}
- mu_stream_ref (carrier);
- smtp->carrier = carrier;
- if (MU_SMTP_FISSET (smtp, _MU_SMTP_TRACE))
- _mu_smtp_trace_enable (smtp);
+ if (carrier)
+ {
+ mu_stream_ref (carrier);
+ smtp->carrier = carrier;
+ if (MU_SMTP_FISSET (smtp, _MU_SMTP_TRACE))
+ _mu_smtp_trace_enable (smtp);
+ }
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.