summaryrefslogtreecommitdiff
path: root/imap
diff options
context:
space:
mode:
Diffstat (limited to 'imap')
-rw-r--r--imap/src/c-client/nntp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/imap/src/c-client/nntp.c b/imap/src/c-client/nntp.c
index 53b51454..67a5d422 100644
--- a/imap/src/c-client/nntp.c
+++ b/imap/src/c-client/nntp.c
@@ -1,5 +1,6 @@
/* ========================================================================
* Copyright 2008-2011 Mark Crispin
+ * Copyright 2019 Eduardo Chappa
* ========================================================================
*/
@@ -9,7 +10,7 @@
* Author: Mark Crispin
*
* Date: 10 February 1992
- * Last Edited: 8 April 2011
+ * Last Edited: July 10, 2019.
*
* Previous versions of this file were:
*
@@ -1806,6 +1807,11 @@ SENDSTREAM *nntp_open_full (NETDRIVER *dv,char **hostlist,char *service,
else if (extok) nntp_extensions (stream,(mb.secflag ? AU_SECURE : NIL) |
(mb.authuser[0] ? AU_AUTHUSER : NIL));
}
+ /* check one last time that we have a netstream before returning
+ * a stream that does not have it. Otherwise, nntp_mail will fail
+ * trying to dereference a null pointer.
+ */
+ if(stream && !stream->netstream) stream = nntp_close(stream);
return stream;
}