Error in termios.c

Wolfram Wadepohl W.Wadepohl at indumat.de
Mon Feb 17 09:48:54 UTC 2003


Hello,

we have detected an error in the termios.c code. in the function 
rtems_termios_open() is memory allocated for various buffers and in the 
case that not enough memory is available totally released before exiting.

the following code is from termios.c Rev. 1.38 and also included in 
Rev.1.39 from SS20030128:
        /*
         * allocate raw output buffer
         */
        tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE;
        tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size);
=>      if (tty->rawInBuf.theBuf == NULL) {
            free((void *)(tty->rawInBuf.theBuf));
            free(tty);
            rtems_semaphore_release (rtems_termios_ttyMutex);
            return RTEMS_NO_MEMORY;
                 ... 
Not for the rawInBuf.theBuf == NULL should be checked, instead for the 
rawOutBuf.theBuf.

-- 
Schöne Grüße aus Reutlingen

Wolfram Wadepohl
Entwicklung

--
INDUMAT GmbH & Co. KG
Transport- und Lagersysteme
Dieselstraße 6
D-72770 Reutlingen - Betzingen

Tel.  +49 (0)71 21/5 14-2 89
Fax   +49 (0)71 21/5 14-2 99
eMail W.Wadepohl at indumat.de
WWW   http://www.indumat.de
--

Bitte senden Sie mir keine Word- oder PowerPoint- (tm Microsoft)  Anhänge.
Senden Sie mir einfachen Text, HTML oder PDF. 
Siehe http://www.fsf.org/philosophy/no-word-attachments.de.html





More information about the users mailing list