apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Vandenberg <jay...@gmail.com>
Subject Re: cppcheck fixes
Date Thu, 08 Jul 2010 12:02:47 GMT
On Tue, Apr 6, 2010 at 7:59 AM, Stefan Fritsch <sf@sfritsch.de> wrote:
> Hi,
>
> I have tried the cppcheck static code analyzer on apr trunk and it
> found some errors that may be worth fixing. For some, I have attached
> a patch.

At first blush, the attached patch looks reasonable.

The changes to threadproc/beos/proc.c appear to fix broken C code.
Time to poke the Beos maintainer?

For dbd/apr_dbd_oracle.c, IMO the declaration should be kept in the
outer scope block. i.e.

    apr_dbd_t *handle;
    if (trans) {
      handle = trans->handle;

I'm not certain about the changes to file_io/unix/open.c, as I'm not
sure whether APR_FOPEN_NOCLEANUP/APR_FILE_NOCLEANUP has some special
meaning here.

> These two I think are false positives/intentional:
>
> [./dso/win32/dso.c:133]: (error) Uninitialized variable: rv
> [./misc/unix/otherchild.c:85]: (error) Possible null pointer
> dereference: cur

Both look ok.

--
John Vandenberg

Mime
View raw message