From a0c0f38cb947a16a5aebf2b59fb8481866d28f96 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 30 Jul 2021 15:56:11 +0100 Subject: sqfs_dir_tree_destroy/sqfs_destroy: allow NULL input Many library destructor functions (like free()) allow a NULL pointer as input, and do nothing in that case. This allows easier cleanup patterns: initialize pointers to NULL and then always pass them to the destroyer functions, no need for verbose goto/if-else patterns. Signed-off-by: Luca Boccassi --- include/sqfs/dir_reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sqfs/dir_reader.h') diff --git a/include/sqfs/dir_reader.h b/include/sqfs/dir_reader.h index 3bef7e3..2ee7204 100644 --- a/include/sqfs/dir_reader.h +++ b/include/sqfs/dir_reader.h @@ -320,7 +320,7 @@ SQFS_API int sqfs_dir_reader_get_full_hierarchy(sqfs_dir_reader_t *rd, * This function can be used to clean up after * @ref sqfs_dir_reader_get_full_hierarchy. * - * @param root A pointer to the root node. + * @param root A pointer to the root node or NULL. */ SQFS_API void sqfs_dir_tree_destroy(sqfs_tree_node_t *root); -- cgit v1.2.3