aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2014-06-02 14:26:59 -0700
committerAleksander Morgado <aleksander@aleksander.es>2014-06-03 10:51:51 +0200
commit7c389511d8d1f86facf93f8884526386457fac85 (patch)
tree07e71518de26357a6bd5b21d392e79621b3a3edf
parent830ef27bac5e3ba54bb3f273b7e3f8b98f572a87 (diff)
tests: fix more memory leaks
-rw-r--r--src/tests/test-modem-helpers.c16
-rw-r--r--src/tests/test-sms-part-3gpp.c1
-rw-r--r--src/tests/test-sms-part-cdma.c1
3 files changed, 14 insertions, 4 deletions
diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c
index cc962619..6175a052 100644
--- a/src/tests/test-modem-helpers.c
+++ b/src/tests/test-modem-helpers.c
@@ -1591,8 +1591,9 @@ test_iccid_parse_short (void *f, gpointer d)
GError *error = NULL;
parsed = mm_3gpp_parse_iccid (raw_iccid, &error);
+ g_assert (parsed == NULL);
g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED);
- g_free (parsed);
+ g_error_free (error);
}
static void
@@ -1603,8 +1604,9 @@ test_iccid_parse_invalid_chars (void *f, gpointer d)
GError *error = NULL;
parsed = mm_3gpp_parse_iccid (raw_iccid, &error);
+ g_assert (parsed == NULL);
g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED);
- g_free (parsed);
+ g_error_free (error);
}
static void
@@ -1615,8 +1617,9 @@ test_iccid_parse_quoted_invalid_mii (void *f, gpointer d)
GError *error = NULL;
parsed = mm_3gpp_parse_iccid (raw_iccid, &error);
+ g_assert (parsed == NULL);
g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED);
- g_free (parsed);
+ g_error_free (error);
}
static void
@@ -1627,8 +1630,9 @@ test_iccid_parse_unquoted_invalid_mii (void *f, gpointer d)
GError *error = NULL;
parsed = mm_3gpp_parse_iccid (raw_iccid, &error);
+ g_assert (parsed == NULL);
g_assert_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED);
- g_free (parsed);
+ g_error_free (error);
}
/*****************************************************************************/
@@ -1840,6 +1844,10 @@ test_cpms_response_cinterion (void *f, gpointer d)
g_assert (mem3->len == 2);
g_assert (is_storage_supported (mem3, MM_SMS_STORAGE_SM));
g_assert (is_storage_supported (mem3, MM_SMS_STORAGE_MT));
+
+ g_array_unref (mem1);
+ g_array_unref (mem2);
+ g_array_unref (mem3);
}
/*****************************************************************************/
diff --git a/src/tests/test-sms-part-3gpp.c b/src/tests/test-sms-part-3gpp.c
index dc470d75..21822f09 100644
--- a/src/tests/test-sms-part-3gpp.c
+++ b/src/tests/test-sms-part-3gpp.c
@@ -360,6 +360,7 @@ test_pdu_insufficient_data (void)
g_assert (part == NULL);
/* We don't care for the specific error type */
g_assert (error != NULL);
+ g_error_free (error);
g_free (hexpdu);
}
diff --git a/src/tests/test-sms-part-cdma.c b/src/tests/test-sms-part-cdma.c
index 644de8dc..17d78966 100644
--- a/src/tests/test-sms-part-cdma.c
+++ b/src/tests/test-sms-part-cdma.c
@@ -399,6 +399,7 @@ common_test_create_pdu (MMSmsCdmaTeleserviceId teleservice_id,
}
pdu = mm_sms_part_cdma_get_submit_pdu (part, &len, &error);
+ mm_sms_part_free (part);
trace_pdu (pdu, len);