From 12ce4ce163e3449348334048093052d9df875862 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 20 Mar 2022 11:17:40 +0100 Subject: [PATCH] only free objectinfo when we got a new one, https://github.com/gphoto/gphoto2/issues/493 --- camlibs/ptp2/library.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index bc2d7d741..992dcc4ea 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -3691,8 +3691,8 @@ enable_liveview: usleep(50*1000); continue; } - - ptp_free_objectinfo(&oi); + if (ret == PTP_RC_OK) + ptp_free_objectinfo(&oi); ret = ptp_getobject_with_size(params, preview_object, &ximage, &size); if (ret == PTP_RC_OK)