• Matthieu Boutier's avatar
    Fix route->channels double-free corruption. · ab66a56a
    Matthieu Boutier authored
    The code assumes that route->channels is NULL when route->channels_len
    is 0, such that free(route->channels) will work.
    
    Think about this scenario:
      update(r, some channels)  # route->channels = malloc(…)
      update(r, no channel)  # free(route->channels)
      update(r, no channel)  # free(route->channels)
    
    Thanks to Dave Taht for pointing the issue.
    ab66a56a
route.c 35.1 KB