static int sm_fwrite(char *, int);
static int sm_fputs(char *);
static int sm_fputc(int);
-static int sm_getc(void);
static void sm_fflush(void);
static int sm_fgets(char *, int, FILE *);
client = "localhost";
#endif
+#ifdef CYRUS_SASL
+ sasl_inbuffer = malloc(SASL_MAXRECVBUF);
+ if (!sasl_inbuffer)
+ return sm_ierror("Unable to allocate %d bytes for read buffer",
+ SASL_MAXRECVBUF);
+#endif /* CYRUS_SASL */
+
if (pipe (pdi) == NOTOK)
return sm_ierror ("no pipes");
if (pipe (pdo) == NOTOK) {
return NOTOK;
}
sasl_outbuflen = 0;
-
- sasl_inbuffer = malloc(SASL_MAXRECVBUF);
-
- if (sasl_inbuffer == NULL) {
- sm_ierror("Unable to allocate %d bytes for SASL input "
- "buffer", SASL_MAXRECVBUF);
- free(sasl_outbuffer);
- return NOTOK;
- }
sasl_inbuflen = 0;
sasl_inptr = sasl_inbuffer;
} else {
sasl_outbuffer = NULL;
- sasl_inbuffer = NULL;
+ /* Don't NULL out sasl_inbuffer because it could be used in
+ sm_fgetc (). */
}
sasl_complete = 1;