mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-08-28 09:55:59 +00:00
203b9e35ca
On several points on swupd we need to free a pointer and then set it to NULL. This is made in some areas using the free_and_clear_pointer(). But most places free_and_clear_pointer() is used, this is not really necessary. On the other hand it's hard to make sure that we are really setting to NULL every pointer that we need, so we're adding a more conservative approach on setting every pointer to NULL after free using a wrapper. The greatest advantage of this wrapper over free_and_clear_pointer() is that it's not type dependent and we don't need to call it with a pointer of a pointer, so calls look more to calls to a standard free. Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>