[PATCH 2/2] msi: Don't leak memory on failure.
Nikolay Sivov
bunglehead at gmail.com
Sun Oct 22 04:21:08 CDT 2017
On 22.10.2017 12:15, Pierre Schweitzer wrote:
> Hi Nikolay,
>
> Thanks for your review. I'm not really keen on mixing success and
> failure path that way for quick understanding of the code.
> Shall I really rewrite the patch the way you asked or was it just a
> proposal?
No, you don't have to do anything just yet, wait for maintainer comment.
>
> Cheers,
> Pierre
>
> Le 21/10/2017 à 12:16, Nikolay Sivov a écrit :
>> On 21.10.2017 12:50, Pierre Schweitzer wrote:
>>> row = MSI_CreateRecord(1);
>>> if (!row)
>>> + {
>>> + msi_free(buffer);
>>> return NULL;
>>> + }
>>> MSI_RecordSetStringW(row, 1, buffer);
>>> msi_free(buffer);
>>> return row;
>>
>> You can replace this with:
>>
>> ---
>> row = MSI_CreateRecord(1);
>> if (row)
>> MSI_RecordSetStringW(row, 1, buffer);
>> msi_free(buffer);
>> return row;
>> ---
>>
>>
>
>
More information about the wine-devel
mailing list