[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] Resource link in rl-fgets.c example file.
From: |
Chet Ramey |
Subject: |
Re: [Bug-readline] Resource link in rl-fgets.c example file. |
Date: |
Sat, 21 Mar 2009 11:47:12 -0400 |
User-agent: |
Thunderbird 2.0.0.21 (Macintosh/20090302) |
William Egert wrote:
> Hi,
>
> Using cppcheck 1.30 against readline 6.0 yields:
>
> [./examples/rl-fgets.c:245]: (error) Resource leak: fp
>
> it looks like you should be doing a close on fp before you return in the
> error condition.
fgets doesn't close fp under any circumstances; an fgets replacement
shouldn't either.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/