From af0bb4a141855c4384003782bb64a6cbbe29753b Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Tue, 8 Dec 2009 10:34:40 +0000 Subject: [PATCH] ntdll: Only free the string if the test succeeded. --- dlls/ntdll/tests/rtlstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c index 80e9efa7384..d9ba0c9eaea 100644 --- a/dlls/ntdll/tests/rtlstr.c +++ b/dlls/ntdll/tests/rtlstr.c @@ -468,7 +468,7 @@ static void test_RtlDuplicateUnicodeString(void) ok(memcmp(dest_str.Buffer, res_str.Buffer, dupl_ustr[test_num].res_buf_size) == 0, "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has destination \"%s\" expected \"%s\"\n", test_num, dupl_ustr[test_num].add_nul, dest_ansi_str.Buffer, dupl_ustr[test_num].res_buf); - pRtlFreeUnicodeString(&dest_str); + if(result == STATUS_SUCCESS) pRtlFreeUnicodeString(&dest_str); } else { ok(dest_str.Buffer == NULL && dupl_ustr[test_num].res_buf == NULL, "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has destination %p expected %p\n", -- 2.11.4.GIT