[gthumb] Warn if file_data_unref called on null data - shouldn't happen
- From: Michael J. Chudobiak <mjc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gthumb] Warn if file_data_unref called on null data - shouldn't happen
- Date: Fri, 1 May 2009 08:44:35 -0400 (EDT)
commit 50f8d2eb20042b615d400a1f427639116931e750
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date: Fri May 1 08:43:14 2009 -0400
Warn if file_data_unref called on null data - shouldn't happen
(cherry picked from commit 32eb51252ce9f50bdb37047bb37beaf6fa29925b)
---
libgthumb/file-data.c | 3 +--
libgthumb/file-utils.c | 3 +++
libgthumb/gth-file-list.c | 1 +
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/libgthumb/file-data.c b/libgthumb/file-data.c
index 3dbc5cb..76a3fae 100644
--- a/libgthumb/file-data.c
+++ b/libgthumb/file-data.c
@@ -173,8 +173,7 @@ file_data_dup (FileData *source)
void
file_data_unref (FileData *fd)
{
- if (fd == NULL)
- return;
+ g_return_if_fail (fd != NULL);
fd->ref--;
diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c
index c9d5615..8a8033c 100644
--- a/libgthumb/file-utils.c
+++ b/libgthumb/file-utils.c
@@ -1714,6 +1714,9 @@ resolve_symlinks (const char *text_uri,
info = gnome_vfs_file_info_new ();
+ if (info == NULL)
+ return GNOME_VFS_ERROR_INVALID_URI;
+
resolved_uri = get_uri_host (text_uri);
tmp = build_uri (text_uri, relative_link, NULL);
diff --git a/libgthumb/gth-file-list.c b/libgthumb/gth-file-list.c
index f551bd1..2f177a1 100644
--- a/libgthumb/gth-file-list.c
+++ b/libgthumb/gth-file-list.c
@@ -1169,6 +1169,7 @@ load_new_list (GthFileList *file_list)
file_list->priv->new_list = g_list_remove_link (file_list->priv->new_list, scan);
file_data_unref (scan->data);
+ g_list_free_1 (scan);
}
scan = next;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]