summaryrefslogtreecommitdiffstats
path: root/libusbmuxd/libusbmuxd.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-07-13 01:39:38 +0200
committerGravatar Nikias Bassen2013-07-13 01:39:38 +0200
commit702a6faac5de45e2279c8a87a529b24a5b64d418 (patch)
treef05d388b8aa78726dde43c485105611c6505e08f /libusbmuxd/libusbmuxd.c
parentf8065b26df76f9057e2d42db8bd1c68825f222c6 (diff)
downloadusbmuxd-702a6faac5de45e2279c8a87a529b24a5b64d418.tar.gz
usbmuxd-702a6faac5de45e2279c8a87a529b24a5b64d418.tar.bz2
libusbmuxd: fix memory leak in device_monitor_cleanup()
Diffstat (limited to 'libusbmuxd/libusbmuxd.c')
-rw-r--r--libusbmuxd/libusbmuxd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libusbmuxd/libusbmuxd.c b/libusbmuxd/libusbmuxd.c
index 31d1c7c..b4afe8e 100644
--- a/libusbmuxd/libusbmuxd.c
+++ b/libusbmuxd/libusbmuxd.c
@@ -604,6 +604,10 @@ int get_next_event(int sfd, usbmuxd_event_cb_t callback, void *user_data)
static void device_monitor_cleanup(void* data)
{
+ FOREACH(usbmuxd_device_info_t *dev, &devices) {
+ collection_remove(&devices, dev);
+ free(dev);
+ } ENDFOREACH
collection_free(&devices);
close_socket(listenfd);