[evolution-ews/wip/get_server_time_zones: 2/6] tests: Let ews_test_data_free() NULL-safe



commit 53113d5c2896a587bb808568eb7808780a2a197d
Author: Fabiano Fidêncio <fidencio redhat com>
Date:   Wed Jan 15 02:02:13 2014 +0100

    tests: Let ews_test_data_free() NULL-safe

 tests/ews-test-common.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/tests/ews-test-common.c b/tests/ews-test-common.c
index 825560b..9d7c1a0 100644
--- a/tests/ews-test-common.c
+++ b/tests/ews-test-common.c
@@ -286,11 +286,15 @@ ews_test_get_test_data_list (void)
 static void
 ews_test_data_free (EwsTestData *etd)
 {
-       g_free (etd->hostname);
-       g_free (etd->version);
-       g_free (etd->server_uri);
-       g_object_unref (etd->connection);
-       g_free (etd);
+       if (etd != NULL) {
+               if (etd->connection != NULL)
+                       g_object_unref (etd->connection);
+
+               g_free (etd->hostname);
+               g_free (etd->version);
+               g_free (etd->server_uri);
+               g_free (etd);
+       }
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]