[haiku-commits] Re: haiku: hrev48686 - src/kits/network/libnetapi

  • From: marcus overhagen <marcusoverhagen@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 17 Jan 2015 15:50:38 +0100

On Fri, Jan 16, 2015 at 3:03 PM,  <pulkomandy@xxxxxxxxxxxxx> wrote:

>                 while (interface->GetAddressAt(i++, address) == B_OK) {
> -                       current = new ifaddrs();
> +                       if (interface == NULL) {

This makes no sense. you already derecerenced the interface pointer

> +                       current = new(std::nothrow) ifaddrs();
> +                       if (current == NULL) {
> +                               freeifaddrs(previous);
you need to delete interface here as well.

regards
Marcus

Other related posts: