small bug fix

This commit is contained in:
pvtrx 2025-12-13 20:05:11 +01:00
parent 321b9630cc
commit 7f765d5373

View File

@ -89,7 +89,7 @@ void *nextTreeData(TreeNode *root)
// Releases all memory resources (including data copies). // Releases all memory resources (including data copies).
void clearTree(TreeNode *root) void clearTree(TreeNode *root)
{ {
if (root == NULL) { if (root != NULL) {
clearTree(root->left); clearTree(root->left);
clearTree(root->right); clearTree(root->right);
free(root->data); free(root->data);