[pacman-dev] [PATCH] add_fileconflict, don't free if CALLOC fail

Rikard Falkeborn rikard.falkeborn at gmail.com
Sun Oct 25 14:45:50 UTC 2015


2015-10-24 21:51 GMT+02:00 Rikard Falkeborn <rikard.falkeborn at gmail.com>:

> If CALLOC fails, conflict is NULL, so we shouldn't
> attempt to free it's members, since that would
> lead to a NULL pointer dereference.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn at gmail.com>
> ---
> Is there a reason none of the alpm_*_free() functions check if the input
> is NULL? That would be more robust, and what I think would be expected,
> since free() accepts NULL as input.
>
>
I sent at patch to check for NULL in alpm_fileconflict_free and a few more
functions. If that's applied, this patch doesn't really add any value.


More information about the pacman-dev mailing list