aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2013-09-03 21:55:23 -0500
committerTed Gould <ted@gould.cx>2013-09-03 21:55:23 -0500
commit2a97f6029b467702a362d0b1b7108717366d903e (patch)
tree5b76d4b6aa0adf7fbf57319deefb2ee9a23e1054 /src
parent9debe3352135af9f53d1e7a979f5a46b5410dd60 (diff)
downloadayatana-indicator-datetime-2a97f6029b467702a362d0b1b7108717366d903e.tar.gz
ayatana-indicator-datetime-2a97f6029b467702a362d0b1b7108717366d903e.tar.bz2
ayatana-indicator-datetime-2a97f6029b467702a362d0b1b7108717366d903e.zip
Don't unref NULLs
Diffstat (limited to 'src')
-rw-r--r--src/service.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/service.c b/src/service.c
index fec2bb1..421e3dd 100644
--- a/src/service.c
+++ b/src/service.c
@@ -577,9 +577,9 @@ get_all_appointments_this_month (IndicatorDatetimeService * self)
if (p->planner != NULL)
{
- GDateTime * calendar_date;
- GDateTime * begin;
- GDateTime * end;
+ GDateTime * calendar_date = NULL;
+ GDateTime * begin = NULL;
+ GDateTime * end = NULL;
int y, m, d;
calendar_date = get_calendar_date (self);
@@ -593,9 +593,12 @@ get_all_appointments_this_month (IndicatorDatetimeService * self)
begin,
end);
- g_date_time_unref (end);
- g_date_time_unref (begin);
- g_date_time_unref (calendar_date);
+ if (end != NULL)
+ g_date_time_unref (end);
+ if (begin != NULL)
+ g_date_time_unref (begin);
+ if (calendar_date != NULL)
+ g_date_time_unref (calendar_date);
}
return appointments;