[PATCH] taskschd/tests: Fix some memory leaks (Valgrind).

Dmitry Timoshkov dmitry at baikal.ru
Tue Jan 15 09:14:40 CST 2019


Sven Baars <sven.wine at gmail.com> wrote:

> >>>>      hr = ITaskService_GetFolder(service, slash, &folder);
> >>>>  todo_wine
> >>>>      ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
> >>>> +    if (hr == S_OK) ITaskFolder_Release(folder);
> >>>>  
> >>>>      hr = ITaskService_GetFolder(service, dot, &folder);
> >>>>  todo_wine
> >>>>      ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* win7 */,
> >>>>         "expected ERROR_INVALID_NAME, got %#x\n", hr);
> >>>> +    if (hr == S_OK) ITaskFolder_Release(folder);
> >>> Fixing Wine code and removing the todo_wine would be a more appropriate fix.
> >>>
> >> Of course, but at the moment I'm just trying to fix all memory leaks
> >> that are present in the tests during the code freeze. That way it is
> >> easier to find and fix actual memory leaks in wine itself after the code
> >> freeze. I already have some patches lined up for that as well.
> > The problem is that this kind of fixes would have to be be removed later,
> > so it's better to not introduce them in the first place.
> >
> But the effort of removing that line is a lot smaller than the effort of
> investigating a trace with a lot of question marks and wrong line
> numbers, which is what this leak generates:

I'd argue that leaving the leaks in place should be a motivation (or annoy
enough) to implement missing functionality instead of silencing Valgrind.

-- 
Dmitry.



More information about the wine-devel mailing list