Menu

Stupid double pointer free issue

2024-04-08
2024-04-09
  • Neil Matthews

    Neil Matthews - 2024-04-08

    Don't know how practical it is to find such an issue, but here's the code with/without the error -- dereferencing in the free() doesn't match dereferencing in the strdup().

     
  • CHR

    CHR - 2024-04-09

    receive_device_info_bad_free() may return a free'd pointer, but only in case the return value is -1. So that should be checked.
    Cppcheck can't prove that any UB will happen here.

     

Log in to post a comment.