git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] win32: syslog: prevent potential realloc memory leak

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 26, 2015, 04:25 UTC
Message-ID
<xmqqzj96mame.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CABPQNSbCF7P23K+uj00PmjJkr=19t=W5wCN0-jweBJYEWgUWRw@mail.gmail.com>
Erik Faye-Lund <kusmabite@gmail.com> writes:
Show 16 quoted lines
> Sorry for very late reply. I had a bug in my mail rules that caused
> this email to skip my inbox. That should be fixed now.
>
> On Mon, Dec 15, 2014 at 7:11 PM, Junio C Hamano <gitster@pobox.com> wrote:
> ...
>> Regardless of that funny %1 business, I notice in
>>
>>     http://msdn.microsoft.com/en-us/library/windows/desktop/aa363679%28v=vs.85%29.aspx
>>
>> that each element of lpStrings array that is passed to ReportEvent()
>> is limited to 32k or so.  Wouldn't it make it a lot simpler if we
>> removed the dynamic allocation and use a fixed sized 32k buffer here
>> (and truncate the result as necessary)?  That would make the "leak"
>> disappear automatically.
>
> That's a very good point. Yes, I think that makes more sense.

OK, so I'd expect a simpler non-reallocating code to materialize and will drop Arjun's patch for now.

Thanks.
Previous: Erik Faye-Lund
Message 4 of 4 in “win32: syslog: prevent potential realloc memory leak”
  1. win32: syslog: prevent potential realloc memory leakArjun Sreedharan, Dec 13, 2014
  2. Junio C HamanoDec 15, 2014
  3. Erik Faye-LundJan 25, 2015
  4. Junio C HamanoJan 26, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.