[evolution-ews] tests: Let ews_test_data_free() NULL-safe
- From: Fabiano Fidêncio <ffidencio src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] tests: Let ews_test_data_free() NULL-safe
- Date: Fri, 17 Jan 2014 13:48:15 +0000 (UTC)
commit aade415e4ec2cdfd4aa3b70b1f43bdbc2e889bc4
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]