services.exe: Reduce Registry access to KEY_READ or MAXIMUM_ALLOWED wherever possible (try 2)
Paul Chitescu
paulc at voip.null.ro
Mon Nov 30 10:00:47 CST 2009
On Monday 30 November 2009 05:51:35 pm Alexandre Julliard wrote:
> Paul Chitescu <paulc at voip.null.ro> writes:
>
> > @@ -569,11 +569,11 @@ DWORD svcctl_ChangeServiceConfigW(
> > new_entry.config.lpDisplayName = strdupW(lpDisplayName);
> > }
> >
> > - *service->service_entry = new_entry;
> > - save_service_config(service->service_entry);
> > + err = save_service_config(&new_entry);
> > + if (ERROR_SUCCESS == err) *service->service_entry = new_entry;
> > service_unlock(service->service_entry);
>
> This can't work, the strings have been freed already.
>
> --
> Alexandre Julliard
> julliard at winehq.org
Oh, I see it now.
This means that currently the old strings are leaked if the new strings
provided are NULL.
I'll write a replacement that will free the all the strings of either old
entry or new entry at the end (depending if save_service_config succeeds or
not).
More information about the wine-devel
mailing list