Commit fa77645e authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

taskschd: Use standard C functions for memory allocation in regtask.c.

parent e0b9fbe5
...@@ -60,8 +60,8 @@ static ULONG WINAPI regtask_Release(IRegisteredTask *iface) ...@@ -60,8 +60,8 @@ static ULONG WINAPI regtask_Release(IRegisteredTask *iface)
{ {
TRACE("destroying %p\n", iface); TRACE("destroying %p\n", iface);
ITaskDefinition_Release(regtask->taskdef); ITaskDefinition_Release(regtask->taskdef);
heap_free(regtask->path); free(regtask->path);
heap_free(regtask); free(regtask);
} }
return ref; return ref;
...@@ -328,10 +328,10 @@ HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinit ...@@ -328,10 +328,10 @@ HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinit
if (!full_name) return E_OUTOFMEMORY; if (!full_name) return E_OUTOFMEMORY;
} }
regtask = heap_alloc(sizeof(*regtask)); regtask = malloc(sizeof(*regtask));
if (!regtask) if (!regtask)
{ {
heap_free(full_name); free(full_name);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -344,15 +344,15 @@ HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinit ...@@ -344,15 +344,15 @@ HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinit
hr = ITaskDefinition_get_XmlText(definition, &xml); hr = ITaskDefinition_get_XmlText(definition, &xml);
if (hr != S_OK || (hr = SchRpcRegisterTask(full_name, xml, flags, NULL, logon, 0, NULL, &actual_path, &error_info)) != S_OK) if (hr != S_OK || (hr = SchRpcRegisterTask(full_name, xml, flags, NULL, logon, 0, NULL, &actual_path, &error_info)) != S_OK)
{ {
heap_free(full_name); free(full_name);
heap_free(regtask); free(regtask);
SysFreeString(xml); SysFreeString(xml);
return hr; return hr;
} }
SysFreeString(xml); SysFreeString(xml);
heap_free(full_name); free(full_name);
full_name = heap_strdupW(actual_path); full_name = wcsdup(actual_path);
MIDL_user_free(actual_path); MIDL_user_free(actual_path);
} }
else else
...@@ -363,8 +363,8 @@ HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinit ...@@ -363,8 +363,8 @@ HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinit
hr = SchRpcRetrieveTask(full_name, L"", &count, &xml); hr = SchRpcRetrieveTask(full_name, L"", &count, &xml);
if (hr != S_OK || (hr = ITaskDefinition_put_XmlText(definition, xml)) != S_OK) if (hr != S_OK || (hr = ITaskDefinition_put_XmlText(definition, xml)) != S_OK)
{ {
heap_free(full_name); free(full_name);
heap_free(regtask); free(regtask);
MIDL_user_free(xml); MIDL_user_free(xml);
return hr; return hr;
} }
...@@ -408,8 +408,8 @@ static ULONG WINAPI regtasks_Release(IRegisteredTaskCollection *iface) ...@@ -408,8 +408,8 @@ static ULONG WINAPI regtasks_Release(IRegisteredTaskCollection *iface)
if (!ref) if (!ref)
{ {
TRACE("destroying %p\n", iface); TRACE("destroying %p\n", iface);
heap_free(regtasks->path); free(regtasks->path);
heap_free(regtasks); free(regtasks);
} }
return ref; return ref;
...@@ -499,12 +499,12 @@ HRESULT RegisteredTaskCollection_create(const WCHAR *path, IRegisteredTaskCollec ...@@ -499,12 +499,12 @@ HRESULT RegisteredTaskCollection_create(const WCHAR *path, IRegisteredTaskCollec
{ {
RegisteredTaskCollection *regtasks; RegisteredTaskCollection *regtasks;
regtasks = heap_alloc(sizeof(*regtasks)); regtasks = malloc(sizeof(*regtasks));
if (!regtasks) return E_OUTOFMEMORY; if (!regtasks) return E_OUTOFMEMORY;
regtasks->IRegisteredTaskCollection_iface.lpVtbl = &RegisteredTaskCollection_vtbl; regtasks->IRegisteredTaskCollection_iface.lpVtbl = &RegisteredTaskCollection_vtbl;
regtasks->ref = 1; regtasks->ref = 1;
regtasks->path = heap_strdupW(path); regtasks->path = wcsdup(path);
*obj = &regtasks->IRegisteredTaskCollection_iface; *obj = &regtasks->IRegisteredTaskCollection_iface;
TRACE("created %p\n", *obj); TRACE("created %p\n", *obj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment