Hi Michal, On Sat, 2019-06-29 at 10:34 +0200, Michał Lowas-Rzechonek wrote: > Hi Inga, > > On 06/28, Inga Stotland wrote: > > +static struct mesh_virtual *add_virtual(const uint8_t *v) > > +{ > > + struct mesh_virtual *virt = l_queue_find(mesh_virtuals, > > + find_virt_by_label, v); > > + > > + if (virt) { > > + virt->ref_cnt++; > > + return virt; > > + } > > + > > + virt = l_new(struct mesh_virtual, 1); > > + > > + if (!mesh_crypto_virtual_addr(v, &virt->addr)) { > > + l_free(virt); > > + return NULL; > > + } > > + > > + memcpy(virt->label, v, 16); > > + virt->ref_cnt++; > > I am aware that l_new zeroes the allocated object, but I think it > would > be clearer to say "virt->ref_cnt = 1" here. > I agree, this is better. Thanks for the review. Inga
Attachment:
smime.p7s
Description: S/MIME cryptographic signature