You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by John Vandenberg <ja...@gmail.com> on 2010/07/08 14:02:47 UTC

Re: cppcheck fixes

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