diff options
author | Ted Gould <ted@gould.cx> | 2013-09-03 21:55:23 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2013-09-03 21:55:23 -0500 |
commit | 2a97f6029b467702a362d0b1b7108717366d903e (patch) | |
tree | 5b76d4b6aa0adf7fbf57319deefb2ee9a23e1054 | |
parent | 9debe3352135af9f53d1e7a979f5a46b5410dd60 (diff) | |
download | ayatana-indicator-datetime-2a97f6029b467702a362d0b1b7108717366d903e.tar.gz ayatana-indicator-datetime-2a97f6029b467702a362d0b1b7108717366d903e.tar.bz2 ayatana-indicator-datetime-2a97f6029b467702a362d0b1b7108717366d903e.zip |
Don't unref NULLs
-rw-r--r-- | src/service.c | 15 |
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; |