Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1999)

Unified Diff: examples/filetree.c

Issue 2345493002: Uprev libmtp to 1.1.12 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libmtp@master
Patch Set: Re-upload cl Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/files.c ('k') | examples/folders.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/filetree.c
diff --git a/examples/filetree.c b/examples/filetree.c
index 6d6ed81905ff74fc15e3045c73ff8f38d2456c31..234d09321b90ca67a642eef285d213beb50ba56f 100644
--- a/examples/filetree.c
+++ b/examples/filetree.c
@@ -49,8 +49,10 @@ void recursive_file_tree(LIBMTP_mtpdevice_t *device,
}
/* Iterate over the filelisting */
- for (file = files; file != NULL; file = file->next) {
+ file = files;
+ while (file != NULL) {
int i;
+ LIBMTP_file_t *oldfile;
/* Indent */
for (i = 0; i < depth; i++) {
@@ -60,6 +62,10 @@ void recursive_file_tree(LIBMTP_mtpdevice_t *device,
if (file->filetype == LIBMTP_FILETYPE_FOLDER) {
recursive_file_tree(device, storage, file->item_id, depth+2);
}
+
+ oldfile = file;
+ file = file->next;
+ LIBMTP_destroy_file_t(oldfile);
}
}
« no previous file with comments | « examples/files.c ('k') | examples/folders.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698