From 6869f89a3078f0717a14dfeec444b7f6f1988551 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sat, 15 Jan 2011 00:28:38 +0300 Subject: [PATCH] comctl32/tests: Fix a leak in rebar test data allocation (Valgrind). --- dlls/comctl32/tests/rebar.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c index 18565020c81..3a01756052d 100644 --- a/dlls/comctl32/tests/rebar.c +++ b/dlls/comctl32/tests/rebar.c @@ -208,17 +208,16 @@ typedef struct { static rbsize_result_t rbsize_init(int cleft, int ctop, int cright, int cbottom, int cyBarHeight, int nRows, int nBands) { - rbsize_result_t *temp; + rbsize_result_t ret; - temp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(rbsize_result_t)); - SetRect(&temp->rcClient, cleft, ctop, cright, cbottom); - temp->cyBarHeight = cyBarHeight; - temp->nRows = 0; - temp->cyRowHeights = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nRows*sizeof(int)); - temp->nBands = 0; - temp->bands = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nBands*sizeof(rbband_result_t)); + SetRect(&ret.rcClient, cleft, ctop, cright, cbottom); + ret.cyBarHeight = cyBarHeight; + ret.nRows = 0; + ret.cyRowHeights = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nRows*sizeof(int)); + ret.nBands = 0; + ret.bands = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nBands*sizeof(rbband_result_t)); - return *temp; + return ret; } static void rbsize_add_row(rbsize_result_t *rbsr, int rowHeight) { @@ -234,7 +233,7 @@ static void rbsize_add_band(rbsize_result_t *rbsr, int left, int top, int right, rbsr->nBands++; } -static rbsize_result_t *rbsize_results = NULL; +static rbsize_result_t *rbsize_results; #define rbsize_results_num 27 -- 2.11.4.GIT