From 214fad46ce2c9a4f3e238ed4e5fc0407f36e5ca8 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 4 Feb 2007 10:14:47 +0000 Subject: [PATCH] gp_list_unref can never free the list due to bad checking. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9971 67ed7778-7388-44ab-90cf-0a291f65f57c --- libgphoto2/gphoto2-list.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libgphoto2/gphoto2-list.c b/libgphoto2/gphoto2-list.c index 4558db909..4edcc46df 100644 --- a/libgphoto2/gphoto2-list.c +++ b/libgphoto2/gphoto2-list.c @@ -143,11 +143,10 @@ gp_list_unref (CameraList *list) { CHECK_LIST (list); - list->ref_count--; - - if (!list->ref_count) + if (list->ref_count == 1) /* time to free */ gp_list_free (list); - + else + list->ref_count--; return (GP_OK); }