> Hi Szymon, Hi, > > + data = g_new(struct oob_data, 1); > > + bacpy(&data->bdaddr, bdaddr); > > + dev->oob_data = g_slist_prepend(dev->oob_data, data); > > Probably g_new0 would be better here (doesn't oob_data have more members > than just the bdaddr? Other members (hash and randomizer) are written right after that if-else. if (match) { data = match->data; } else { data = g_new(struct oob_data, 1); bacpy(&data->bdaddr, bdaddr); dev->oob_data = g_slist_prepend(dev->oob_data, data); } memcpy(data->hash, hash, sizeof(data->hash)); memcpy(data->randomizer, randomizer, sizeof(data->randomizer)); So there is no need for zeroing data on allocation. -- BR Szymon Janc -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html