Foo Bar
Foo Bar

Reputation: 131

Static analysis tool for C programs

I'm looking for Static Analysis open-source tool for these,

  1. Checking the return value of the function.

    foobar = Get_FooBar(...); //this function could return null pointer. 
    foobar->property = value;  //no null check here! 
    
  2. Pointer returned by malloc.

    foobar = (void *)malloc(..);
    foobar->property = value; //return value of malloc is not checked. 
    

cppcheck doesn't capture this, AFAIK. Any other open-source/freeware you folks recommend?

Upvotes: 2

Views: 950

Answers (2)

alexey
alexey

Reputation: 622

You can try PVS-Studio it's not free but you can use free trial (without filling any forms) to find memory issues.

Upvotes: 0

Related Questions