/*
- * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004-2010 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
continue;
}
mc = _MALLOC(sizeof(struct multicast_entry), M_DEVBUF, M_WAITOK);
+ if (mc == NULL) {
+ error = ENOBUFS;
+ break;
+ }
bcopy(LLADDR(&source_sdl), LLADDR(&target_sdl), alen);
error = ifnet_add_multicast(target_ifp, (struct sockaddr *)&target_sdl,
&mc->mc_ifma);
(void)multicast_list_remove(mc_list);
*mc_list = new_mc_list;
}
+ ifnet_free_multicast_list(source_multicast_list);
return (error);
}