Hi Frédéric,<br><div class="gmail_extra"><br></div><div class="gmail_extra">thanks for the patch. Allow me to elaborate:<br><br><div class="gmail_quote">On Tue, Nov 6, 2012 at 6:05 AM, Alexandre Julliard <span dir="ltr"><<a href="mailto:julliard@winehq.org" target="_blank">julliard@winehq.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Frédéric Delanoy <<a href="mailto:frederic.delanoy@gmail.com" target="_blank">frederic.delanoy@gmail.com</a>> writes:<br>


<br>
> @@ -1520,8 +1521,8 @@ DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL<br>
>             sizeof(MIB_IPADDRROW), IpAddrTableSorter);<br>
>          ret = NO_ERROR;<br>
>        }<br>
> -      HeapFree(GetProcessHeap(), 0, table);<br>
>      }<br>
> +    HeapFree(GetProcessHeap(), 0, table);<br>
>    }<br>
<br>
That's not the correct fix.<br></blockquote><div><br></div><div>The correct place to fix is getIpAddrTable in ifenum.c, so that should it fail, it frees the memory it allocated. This was obviously an oversight on my part. See the for loop here:</div>

<div><a href="http://source.winehq.org/source/dlls/iphlpapi/ifenum.c#L735" target="_blank">http://source.winehq.org/source/dlls/iphlpapi/ifenum.c#L735</a></div><div><br></div><div>This loop terminates if something fails, so after the for loop is an ideal place to add a HeapFree. In this way, the callers (GetIpAddrTable is but one) never have to cope with freeing memory when getIpAddrTable fails.</div>
<div>--Juan</div>
</div></div>