diff options
author | Nikias Bassen | 2014-03-02 03:32:54 +0100 |
---|---|---|
committer | Nikias Bassen | 2014-03-02 03:32:54 +0100 |
commit | d2eb680e18d08e0d64702e56b47c4ceddb44d6c8 (patch) | |
tree | 97c2b4d8a4afc6dc10b09aeda97f4dc620d4c0da /src | |
parent | c7c54f3623fa6928c5f14e544938547b1dccbeed (diff) | |
download | libusbmuxd-d2eb680e18d08e0d64702e56b47c4ceddb44d6c8.tar.gz libusbmuxd-d2eb680e18d08e0d64702e56b47c4ceddb44d6c8.tar.bz2 |
plug several memory leaks
Diffstat (limited to 'src')
-rw-r--r-- | src/libusbmuxd.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c index 7ef58ea..442b6e0 100644 --- a/src/libusbmuxd.c +++ b/src/libusbmuxd.c @@ -829,12 +829,15 @@ retry: plist_t props = plist_dict_get_item(pdev, "Properties"); dev = device_record_from_plist(props); usbmuxd_device_info_t *devinfo = device_info_from_device_record(dev); + free(dev); if (!devinfo) { DEBUG(1, "%s: can't create device info object\n", __func__); + plist_free(list); return -1; } collection_add(&tmpdevs, devinfo); } + plist_free(list); goto got_device_list; } } else { @@ -843,8 +846,10 @@ retry: } socket_close(sfd); try_list_devices = 0; + plist_free(list); goto retry; } + plist_free(list); } } @@ -1103,8 +1108,7 @@ int usbmuxd_read_buid(char **buid) } else { ret = -(int)rc; } - if (pl) - plist_free(pl); + plist_free(pl); } return ret; @@ -1150,8 +1154,7 @@ int usbmuxd_read_pair_record(const char* record_id, char **record_data, uint32_t } else { ret = -(int)rc; } - if (pl) - plist_free(pl); + plist_free(pl); } return ret; |