Menu

NULL Return

2015-02-17
2015-02-19
  • Joshua Rogers

    Joshua Rogers - 2015-02-17

    Hi,

    I think it would be a great feature if cppcheck could report if the return value is being used somewhere, and it may return NULL.

    e.g.:

    char whatever() {
    char
    yeah = malloc(15);
    return yeah;
    }

    ^ this code may return NULL(since malloc may return NULL)

    if it is later used without checking against null, it should report that.

    Thanks

     
  • Daniel Marjamäki

    yes sounds good. somebody should create a ticket for this in our issue tracker (http://trac.cppcheck.net). can you create it?

     
  • Joshua Rogers

    Joshua Rogers - 2015-02-19

    I joined the IRC chan #cppcheck on freenode, but you(I assume danmar is you) are not in there, so I can't submit my htpasswd for openid.

    megamansec:$apr1$6d2dd4Sf$kYGJ7JnFtB4RKYxsMLNs6/ is it, however.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.