[PATCH] Erase memory before freeing.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Aug 1 16:40:21 CEST 2016


On Mon 2016-08-01 06:15:31 -0400, Justus Winter wrote:
>> +    {
>> +      UNLOCK (memlist_lock);
>> +      return _gpgme_assuan_malloc (n);
>> +    }
>> +
>> +  tmp = _gpgme_assuan_malloc (n);
>
> Can't we just use realloc here?  And if not for some reason, please
> don't look newitem up like this, instead create a variant of
> _gpgme_assuan_malloc that returns the item.

I assume the concern about realloc is that it might copy the memory to a
new location, freeing the old memory without wiping it first.

    --dkg



More information about the Gnupg-devel mailing list