2 comments

[ 2.9 ms ] story [ 17.8 ms ] thread
shouldn't that be

  if(parent == NULL || parent->children == NULL) {
in get_swayc_for_handle ?
Because get_swayc_for_handle is always called using the root container, when it recurses down it should never end up checking a parent which is NULL.