[librsvg] test-display: Fix potential g_object_unref(NULL) call
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] test-display: Fix potential g_object_unref(NULL) call
- Date: Fri, 29 Nov 2013 13:21:13 +0000 (UTC)
commit 6f6be8c524cc42828eb87c10b54a242c6a2484e3
Author: Philip Withnall <philip withnall collabora co uk>
Date: Fri Nov 29 12:55:23 2013 +0000
test-display: Fix potential g_object_unref(NULL) call
base_file can legitimately be NULL at this point.
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=719552
test-display.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/test-display.c b/test-display.c
index 7223126..4b8929b 100644
--- a/test-display.c
+++ b/test-display.c
@@ -752,7 +752,8 @@ main (int argc, char **argv)
RSVG_HANDLE_FLAGS_NONE,
NULL /* cancellable */,
&err);
- g_object_unref (base_file);
+ if (base_file != NULL)
+ g_object_unref (base_file);
g_object_unref (input);
if (info.handle == NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]