@@ -1663,9 +1663,6 @@ apteryx_query_full (GNode *root)
1663
1663
rpc_msg_encode_uint8 (& msg , MODE_QUERY );
1664
1664
rpc_msg_encode_tree (& msg , root );
1665
1665
1666
- /* Now that the node has been encoded, strip the NULL nodes back off again */
1667
- g_node_traverse (root , G_IN_ORDER , G_TRAVERSE_LEAVES , -1 , remove_null_data , NULL );
1668
-
1669
1666
if (!rpc_msg_send (rpc_client , & msg ))
1670
1667
{
1671
1668
ERROR ("QUERY: No response Path(%s)\n" , path );
@@ -1740,13 +1737,19 @@ apteryx_query_full (GNode *root)
1740
1737
GNode *
1741
1738
apteryx_query (GNode * root )
1742
1739
{
1740
+ GNode * query_result ;
1743
1741
/* the g_node tree that gets passed in here it different from an apteryx tree
1744
1742
* used for get / set tree operations - value leaf nodes don't get created.
1745
1743
* We need them for the encode tree, so add them now.
1746
1744
*/
1747
1745
ASSERT (root , return NULL , "QUERY: Invalid parameters\n" );
1748
1746
g_node_traverse (root , G_IN_ORDER , G_TRAVERSE_LEAVES , -1 , add_null_data , NULL );
1749
- return apteryx_query_full (root );
1747
+
1748
+ query_result = apteryx_query_full (root );
1749
+
1750
+ /* Now that the node has been encoded, strip the NULL nodes back off again */
1751
+ g_node_traverse (root , G_IN_ORDER , G_TRAVERSE_LEAVES , -1 , remove_null_data , NULL );
1752
+ return query_result ;
1750
1753
}
1751
1754
1752
1755
GList *
0 commit comments