Index: ossp-pkg/lmtp2nntp/lmtp.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp.c,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp.c,v' 2>/dev/null --- lmtp.c 2001/07/26 15:18:57 1.7 +++ lmtp.c 2001/08/01 07:07:55 1.8 @@ -96,12 +96,12 @@ * the _io_ structure by NULLing it causes use of the system default * function. */ - lmtp_t *lmtp = NULL; + lmtp_t *lmtp; if ((lmtp = (lmtp_t *)malloc(sizeof(lmtp_t))) == NULL) return NULL; - if(io == NULL) { + if (io == NULL) { lmtp->io.read = read; lmtp->io.write = write; } else { @@ -128,6 +128,8 @@ { int i; + if (lmtp == NULL) + return; for (i = 0; (i < LMTP_MAXVERBS) && (lmtp->dispatch[i] != NULL); i++) free(lmtp->dispatch[i]); /* lmtp_register() */ free(lmtp->dispatch); /* lmtp_create() */ @@ -142,6 +144,8 @@ char c; lmtp_readline_t *rl = &lmtp->rl; + if (lmtp == NULL) + return LMTP_ERR_ARG; for (n = 0; n < buflen-1;) { /* fetch one character (but read more) */