summaryrefslogtreecommitdiff
path: root/include/sqfs
diff options
context:
space:
mode:
Diffstat (limited to 'include/sqfs')
-rw-r--r--include/sqfs/dir_reader.h2
-rw-r--r--include/sqfs/predef.h5
2 files changed, 4 insertions, 3 deletions
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);
diff --git a/include/sqfs/predef.h b/include/sqfs/predef.h
index 6296b4b..a976cd4 100644
--- a/include/sqfs/predef.h
+++ b/include/sqfs/predef.h
@@ -133,11 +133,12 @@ typedef struct sqfs_object_t {
*
* @memberof sqfs_object_t
*
- * @param obj A pointer to an object
+ * @param obj A pointer to an object or NULL
*/
static SQFS_INLINE void sqfs_destroy(void *obj)
{
- ((sqfs_object_t *)obj)->destroy((sqfs_object_t *)obj);
+ if (obj)
+ ((sqfs_object_t *)obj)->destroy((sqfs_object_t *)obj);
}
/**