Counting unival subtrees - Follow Up This code is a revised version of the implementation which asked for an advice on improvement. Original post here: Counting unival subtrees
Credits to: [Deduplicator], [Reinderien], [Toby Speight], [chux].
The revised version was applied following changes:

Merge insertRight(), insertLeft() function into createNode function
free resources after use
used const if referenced memory address value is not altered.
fix isTreeUniv() into recursive version
get rid of globals

Revised code:
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;stdbool.h&gt;

typedef struct stTree
{
    struct stTree *left;
    struct stTree *right;
    int value;
} stTree;

stTree* createNode(int value, stTree *leftNode, stTree *rightNode)
{
    stTree *node = malloc(sizeof *node);
    if (!node) abort();

    node-&gt;left = leftNode;
    node-&gt;right = rightNode;
    node-&gt;value = value;

    return node;
}

bool isUnivSubTimpl(const stTree *node, const stTree *parent, size_t *count)
{
    if (!node) return 1;    //node without child count as unival subT

    bool r = isUnivSubTimpl(node-&gt;left, node, count) &amp;isUnivSubTimpl(node-&gt;right, node, count);
    *count += r;

    return (r &amp;node-&gt;value == parent-&gt;value);
}

size_t countUnivSubT(const stTree *node)
{
    size_t count = 0;
    isUnivSubTimpl(node, node, &amp;count);
    return count;
}

static stTree* findBottomLeft(stTree *node)
{
    while (node-&gt;left)
        node = node-&gt;left;
    return node;
}

bool freeTree(stTree *node)
{
    if (!node) return true;
    stTree *bottomLeft = findBottomLeft(node);

    while (node)
    {
        if (node-&gt;right)
        {
            bottomLeft-&gt;left = node-&gt;right;
            bottomLeft = findBottomLeft(bottomLeft);
        }

        stTree *old = node;
        node = node-&gt;left;
        free(old);
    }
        return true;
}

int main(void)
{
    //build a tree
    stTree *rootNode =
        createNode(0,
            createNode(1, NULL, NULL),
            createNode(0,
                createNode(1,
                    createNode(1, NULL, NULL),
                    createNode(1, NULL, NULL)
               ),
                createNode(0, NULL, NULL)));

    printf(&quot;total universal subree: %u\n&quot;, countUnivSubT(rootNode));
    if (freeTree(rootNode))
        printf(&quot;memory released\n&quot;);

}
Good job - it's nice to see improvements from the reviews you've received.
I would recommend using logical &amp;&amp; rather than bitwise &amp; in the computation r &amp;node-&gt;value == parent-&gt;value.  Results should be the same, but programmers expect to see logical operators with boolean values.
The computation of r cannot use &amp;&amp; as is, because the right-hand side does need to be evaluated for its side-effects, even when the left-hand side is false.  I'd consider rewriting as separate expressions, so a future maintainer doesn't &quot;correct&quot; the &amp; to &amp;&amp;:
bool l_un = isUnivSubTimpl(node-&gt;left, node, count);  /* updates *count */
bool r_un = isUnivSubTimpl(node-&gt;right, node, count); /* updates *count */
bool r = l_un &amp;&amp; r_un;

Identifiers beginning with is are reserved for Standard Library extension, so I'd advise changing the name isUnivSubTimpl, particularly as it has external linkage.
It isn't clear to me why freeTree() returns a bool, as it only ever returns true.
Building the tree could be simplified a little with
stTree *createLeafNode(int value)
{
    return createNode(value, NULL, NULL);
}