Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 1 Jan 2013 15:30:29 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Rejecting hashes in valid() due to memory allocation failures?

On 31 Dec, 2012, at 19:35 , Lukas Odzioba <lukas.odzioba@...il.com> wrote:

> 2012/12/31 Lukas Odzioba <lukas.odzioba@...il.com>:
>> 2012/12/31 Lukas Odzioba <lukas.odzioba@...il.com>:
>>> 2012/12/30 magnum <john.magnum@...hmail.com>:
>>>> If/when we search & replace these, we should check for ones that should be replaced with mem_alloc_tiny() instead (in particular, ones that lack a corresponding free()).
>>> 
>>> I am a volunteer to do that.
>> 
>> In opencl_zip_fmt.c (and some others) I see that inbuffer and
>> outbuffer are alocated by malloc(), but cracked is alocated by
>> mem_calloc_tiny().
>> 
>> All of above are alocated only once in init() and don't have free() calls.
>> 
>> Is there a reason for that?
> 
> I fixed easy ones. Now I am waiting for decision about big in/out
> buffers in fmt files.
> 
> Lukas
> <mem_alloc-fixes.diff>


Thanks, I'll commit your patch. I think the best is to add a 'static void done(void)' function that frees resources using MEM_FREE macro. For now you could add an atexit(done) to init(), and for next core version we'll have done() as a format method (with a self parameter added).

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.