[pacman-dev] [PATCH v3 0/4] pacman/upgrade

Allan McRae allan at archlinux.org
Thu Mar 13 02:02:33 EDT 2014

On 12/03/14 14:03, Sören Brinkmann wrote:
> On Wed, 2014-03-12 at 01:16PM +1000, Allan McRae wrote:
>> On 12/03/14 12:29, Sören Brinkmann wrote:
>>> So, Andrew urged me to dive a little deeper into this and here's the
>>> result. On top of the original fix for the potential NULL-pointer
>>> dereference there are three more patches now. Those address the memory
>>> management and error paths in the upgrade code.
>>> 	Sören
>>> Sören Brinkmann (4):
>>>   pacman/upgrade: Check malloc() return value
>>>   pacman/upgrade: Refactor memory management
>>>   pacman/upgrade: Fix memory leaks
>>>   pacman/upgrade: Bail early on errors
>>>  src/pacman/upgrade.c | 52 ++++++++++++++++++++++++++++++++--------------------
>>>  1 file changed, 32 insertions(+), 20 deletions(-)
>> I have only had a quick look.  But patch #2 removes changes made in
>> patch #1
> I kept fixing the NULL-pointer dereference and refactoring separated. If
> the refactoring turns out to be buggy it could be reverted without
> re-intorducing the NULL-pointer dereference.

Far enough.  I'm always requesting patches are broken into smaller
chunks, so I will go with that.

>> and patch #3 corrects a memory leak made in patch #2. 
> Not fully true. Before, the memory management was just more subtle,
> hidden in alpm_list_add and FREELIST, the leak was already there.

You are correct.   I blame grant and fellowship writing season for
destroying my brain.


More information about the pacman-dev mailing list