Menu

addrinfo free'ing

2015-02-20
2018-02-01
  • Joshua Rogers

    Joshua Rogers - 2015-02-20

    Hi,

    When using getaddrinfo(), memory is allocated which later needs to be
    freed using freeaddrinfo().

    From the manual:

       int getaddrinfo(const char *node, const char *service,
                       const struct addrinfo *hints,
                       struct addrinfo **res);
    
       void freeaddrinfo(struct addrinfo *res);
    
       The freeaddrinfo() function frees the memory that was allocated
    

    for the dynamically allocated linked list res.

     
  • versat

    versat - 2018-02-01

    Related ticket as far as i see: https://trac.cppcheck.net/ticket/6994

     

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.