[PATCH] huawei plugin: fix memory leaks in tests.

Yunlian Jiang yunlian at chromium.org
Wed Mar 25 09:30:28 PDT 2015


---
 plugins/huawei/tests/test-modem-helpers-huawei.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/plugins/huawei/tests/test-modem-helpers-huawei.c
b/plugins/huawei/tests/test-modem-helpers-huawei.c
index 9e92eee..ef1118a 100644
--- a/plugins/huawei/tests/test-modem-helpers-huawei.c
+++ b/plugins/huawei/tests/test-modem-helpers-huawei.c
@@ -1087,6 +1087,9 @@ test_nwtime (void)

         if (iso8601)
             g_free (iso8601);
+
+       if (tz)
+           g_free (tz);
     }
 }

@@ -1128,6 +1131,8 @@ test_time (void)

         g_assert_cmpstr (time_tests[i].iso8601, ==, iso8601);

+       g_clear_error (&error);
+
         if (iso8601)
             g_free (iso8601);
     }
--
2.2.0.rc0.207.ga3a616c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/modemmanager-devel/attachments/20150325/383ed366/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-huawei-plugins-fix-two-memory-leaks-in-unittest.patch
Type: text/x-patch
Size: 712 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/modemmanager-devel/attachments/20150325/383ed366/attachment.bin>


More information about the ModemManager-devel mailing list