[cfe-dev] scan-build - need help

Suzzane G gsuzzane at gmail.com
Fri Oct 14 07:07:04 PDT 2011


HI,

Here is my test program and I expected scan-build to detect resource leak.
But it is not detecting resource leak. Will you please let me know why this
defect is not detected?

#include <stdio.h>
#include <stdlib.h>

int func (char *r)
{
        int x = 0;
        char *p = NULL;

        p = malloc(100);
        return (0);
}

Command used is "scan-build -o . --use-cc=/usr/bin/gcc-4.5 gcc -c ~/test.c"

Rgds,
Suz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111014/2b781c32/attachment.html>


More information about the cfe-dev mailing list