aboutsummaryrefslogtreecommitdiff
path: root/src/tests/test-modem-helpers.c
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 /src/tests/test-modem-helpers.c
parent830ef27bac5e3ba54bb3f273b7e3f8b98f572a87 (diff)
tests: fix more memory leaks
Diffstat (limited to 'src/tests/test-modem-helpers.c')
-rw-r--r--src/tests/test-modem-helpers.c16
1 files changed, 12 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);
}
/*****************************************************************************/