libimobiledevice/libplist — pull request #24 by bzm97 (2014-05-08 16:26:36+00:00)
Title: Fix some leaks in bplist.c

Hi, it seems I've found some leaks in plist_from_bin: somewhy not all nodes are attached to the resulting tree, so plist_free do not free all of the parsed ones.

Here's valgrind's output before fix:
```
==7283== HEAP SUMMARY:
==7283== in use at exit: 115,968 bytes in 2,600 blocks
==7283== total heap usage: 150,382 allocs, 147,782 frees, 10,447,392 bytes allocated
==7283==
==7283== 4,624 (2,720 direct, 1,904 indirect) bytes in 34 blocks are definitely lost in loss record 203 of 206
==7283== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7283== by 0x505C493: node_create (node.c:50)
==7283== by 0x50598A0: parse_bin_node (bplist.c:466)
==7283== by 0x5059D38: plist_from_bin (bplist.c:650)
==7283== by 0x4E40897: internal_plist_receive_timeout (property_list_service.c:226)
==7283== by 0x4E459D6: instproxy_browse (installation_proxy.c:186)
...
==7283== 104,176 (61,280 direct, 42,896 indirect) bytes in 766 blocks are definitely lost in loss record 206 of 206
==7283== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7283== by 0x505C493: node_create (node.c:50)
==7283== by 0x50593B6: parse_bin_node (bplist.c:457)
==7283== by 0x5059D38: plist_from_bin (bplist.c:650)
==7283== by 0x4E40897: internal_plist_receive_timeout (property_list_service.c:226)
==7283== by 0x4E459D6: instproxy_browse (installation_proxy.c:186)
...
==7283== LEAK SUMMARY:
==7283== definitely lost: 64,000 bytes in 800 blocks
==7283== indirectly lost: 44,800 bytes in 1,600 blocks
==7283== possibly lost: 0 bytes in 0 blocks
==7283== still reachable: 7,168 bytes in 200 blocks
==7283== suppressed: 0 bytes in 0 blocks
==7283== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 641 from 180)
```

And after:

```
==7984== LEAK SUMMARY:
==7984== definitely lost: 0 bytes in 0 blocks
==7984== indirectly lost: 0 bytes in 0 blocks
==7984== possibly lost: 0 bytes in 0 blocks
==7984== still reachable: 7,168 bytes in 200 blocks
==7984== suppressed: 0 bytes in 0 blocks
```
Thanks a lot for your work, guys!