Fix some ugliness

Holger Hans Peter Freyther holger at freyther.de
Thu Nov 29 07:52:49 UTC 2012


On Wed, Nov 28, 2012 at 10:08:18PM +0100, Frank A. Stevenson wrote:
Hi Frank,

> 
> I hope this passes muster, functionally it is the same as before, but
> tetra-rx now accepts multiplexed input. Make clean is required.

My two cents..

+				carrier_table[cid] = talloc_zero(tetra_tall_ctx, struct tetra_rx_carrier);
+				init_carrier(carrier_table[cid],(uint16_t)cid);

should become carrier_table[cid] = tetra_create_carrier(cid); and the deinit then just
tetra_delete_carrier(carrier_table[cid]) which then talloc free's the root. This way
you can skip the NULL check and you stop to delete memory. talloc_free(NULL) will not
cause a crash.

holger

PS: Feel free to send the entire patch to the ML.




More information about the tetra mailing list