Fix memory leak in StringHelper tests

Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/34cb21de
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/34cb21de
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/34cb21de

Branch: refs/heads/master
Commit: 34cb21deef514e74483395d15f8cd9fb244f3ed2
Parents: 5c7f068
Author: Nick Wellnhofer <[email protected]>
Authored: Sat May 14 18:48:14 2016 +0200
Committer: Nick Wellnhofer <[email protected]>
Committed: Sat May 14 18:53:46 2016 +0200

----------------------------------------------------------------------
 runtime/core/Clownfish/Test/Util/TestStringHelper.c | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/34cb21de/runtime/core/Clownfish/Test/Util/TestStringHelper.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/Util/TestStringHelper.c 
b/runtime/core/Clownfish/Test/Util/TestStringHelper.c
index 03895b6..891f9cc 100644
--- a/runtime/core/Clownfish/Test/Util/TestStringHelper.c
+++ b/runtime/core/Clownfish/Test/Util/TestStringHelper.c
@@ -271,6 +271,7 @@ test_validate_utf8(TestBatchRunner *runner) {
         const char *expected = "Invalid UTF-8 after 'Sigma': C1 9C 2E\n";
         bool ok = Str_Starts_With_Utf8(mess, expected, strlen(expected));
         TEST_TRUE(runner, ok, "validate_utf8 throws correct error message");
+        DECREF(error);
     }
 
     {
@@ -283,6 +284,7 @@ test_validate_utf8(TestBatchRunner *runner) {
             "1234567890': C1 9C 2E\n";
         bool ok = Str_Starts_With_Utf8(mess, expected, strlen(expected));
         TEST_TRUE(runner, ok, "validate_utf8 truncates long prefix");
+        DECREF(error);
     }
 }
 

Reply via email to