summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Peter Hoepfner2011-10-19 20:40:09 +0200
committerGravatar Martin Szulecki2012-03-22 18:51:12 +0100
commitd7b96dcab3c1e5dcd24d69a34f8f5da186062f3d (patch)
tree7f07617e061a30c0f291641065630827ced7c9ae
parent856576e792d06baf4b97eda688fef65198aab497 (diff)
downloadlibimobiledevice-d7b96dcab3c1e5dcd24d69a34f8f5da186062f3d.tar.gz
libimobiledevice-d7b96dcab3c1e5dcd24d69a34f8f5da186062f3d.tar.bz2
Fix memory leak in idevice_device_list_free
-rw-r--r--src/idevice.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/idevice.c b/src/idevice.c
index 3676b5c..cad1431 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -134,8 +134,9 @@ idevice_error_t idevice_device_list_free(char **devices)
{
if (devices) {
int i = 0;
- while (devices[i++]) {
+ while (devices[i]) {
free(devices[i]);
+ i++;
}
free(devices);
}