most FREE_SET_NULL replaced with free

FREE_SET_NULL makes extra assignment of NULL for pointers in stack or
dynamic memory that is going to be freed.
FREE_SET_NULL is useful for pointers that can be used in future.
This commit is contained in:
Dmitry Podgorny
2013-08-03 14:27:07 +03:00
parent 6f498d1f69
commit 0346fda0b3
11 changed files with 73 additions and 86 deletions

View File

@@ -301,17 +301,16 @@ static void
_caps_destroy(Capabilities *caps)
{
if (caps != NULL) {
FREE_SET_NULL(caps->category);
FREE_SET_NULL(caps->type);
FREE_SET_NULL(caps->name);
FREE_SET_NULL(caps->software);
FREE_SET_NULL(caps->software_version);
FREE_SET_NULL(caps->os);
FREE_SET_NULL(caps->os_version);
free(caps->category);
free(caps->type);
free(caps->name);
free(caps->software);
free(caps->software_version);
free(caps->os);
free(caps->os_version);
if (caps->features != NULL) {
g_slist_free_full(caps->features, free);
caps->features = NULL;
}
FREE_SET_NULL(caps);
free(caps);
}
}