Huw Davies : ntdll: Only free the string if the test succeeded.

Alexandre Julliard julliard at winehq.org
Tue Dec 8 11:10:37 CST 2009


Module: wine
Branch: master
Commit: af0bb4a141855c4384003782bb64a6cbbe29753b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=af0bb4a141855c4384003782bb64a6cbbe29753b

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Dec  8 10:34:40 2009 +0000

ntdll: Only free the string if the test succeeded.

---

 dlls/ntdll/tests/rtlstr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c
index 80e9efa..d9ba0c9 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",




More information about the wine-cvs mailing list