davidvossel/pacemaker — comment on commit e6d6c666b3d1d41208098a8f1b91224ddf5681d2
File: fencing/standalone_config.c line 203
By davidvossel:

Doing sizeof(*topo) is my preferred way of doing it because I am guaranteed not to make any mistakes. For example, if I copy and pasted the malloc line from the device and topology functions I could end up with this line,

crm_malloc0(topo, sizeof(struct device))

which would totally compile. Hopefully it would get caught during review or testing, but it could slip in.