comctl32/tests: Fix a leak in rebar test data allocation (Valgrind).

oldstable
Nikolay Sivov 2011-01-15 00:28:38 +03:00 committed by Alexandre Julliard
parent e61fd95146
commit 6869f89a30
1 changed files with 9 additions and 10 deletions

View File

@ -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