[pacman-dev] [PATCH] Fix some memleaks in alpm/add.c

Xavier shiningxc at gmail.com
Wed Jul 16 07:12:47 EDT 2008


2008/7/16 Nagy Gabor <ngaba at bibl.u-szeged.hu>:
> Idézés Dan McGee <dpmcgee at gmail.com>:
>
>> On Tue, Jul 15, 2008 at 6:36 AM, Nagy Gabor <ngaba at bibl.u-szeged.hu> wrote:
>> > >From b9673a106b1f985cb81f620f394620e6eca88516 Mon Sep 17 00:00:00 2001
>> > From: Nagy Gabor <ngaba at bibl.u-szeged.hu>
>> > Date: Tue, 15 Jul 2008 13:30:34 +0200
>> > Subject: [PATCH] Fix some memleaks in alpm/add.c
>> >
>> > In case of error some allocated memory wasn't freed in commit_single_pkg.
>> > Note: The return value of this function is not used.
>> >
>> > Signed-off-by: Nagy Gabor <ngaba at bibl.u-szeged.hu>
>> > ---
>>
>> Thanks. Perhaps we should use the return value?
>>
>
> Well, now our add code won't stop in case of error just go ahead;-)
> As I guessed this behaviour change was introduced by commit
> 591bfabbd38bf4f8f209977f416a4e5fd3cc2baf, where we split the huge add_commit
> function. So to answer to your question, I think we should. Others?
>

There is no point discussing whether we should use it or not, what is
important is to discuss *how* to use it.
There are two main ways :
1) just printing a message : error, warning or just debug ?
2) stops here, and probably returning -1 . Should we run ldconfig
before returning?

The ldconfig question in case 2 also applies to the case where we
cancel a transaction with ctrl+c (sate_interrupted).




More information about the pacman-dev mailing list