The following functions return immediately if a null pointer was passed.
* container_destroy
* lxc_cgroup_process_info_free_and_remove
* lxc_cgroup_put_meta
* toss_list
It is therefore not needed that a function caller repeats a corresponding check.
This issue was fixed by using the software Coccinelle 1.0.0-rc23.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
if (!d)
return;
free(d->name);
- if (d->info)
- lxc_cgroup_process_info_free_and_remove(d->info);
- if (d->meta)
- lxc_cgroup_put_meta(d->meta);
+ lxc_cgroup_process_info_free_and_remove(d->info);
+ lxc_cgroup_put_meta(d->meta);
free(d);
}
if ( lxc_container_put(c) > 0 ) {
containers[i] = NULL;
}
- if ( c_groups_lists && c_groups_lists[i] ) {
+ if ( c_groups_lists ) {
toss_list(c_groups_lists[i]);
c_groups_lists[i] = NULL;
}
}
free(c_groups_lists);
-
- if ( cmd_groups_list ) {
- toss_list( cmd_groups_list );
- }
-
+ toss_list( cmd_groups_list );
free(containers);
return 0;
if (partial_fd >= 0)
remove_partial(c, partial_fd);
out:
- if (!ret && c)
+ if (!ret)
lxcapi_destroy(c);
free_tpath:
free(tpath);