summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/conflict.c
diff options
context:
space:
mode:
authorRikard Falkeborn <rikard.falkeborn@gmail.com>2015-10-25 12:39:27 +0100
committerAllan McRae <allan@archlinux.org>2015-10-27 05:22:30 +0100
commit0c5dbdbfeca8a26d015230a8edd6d7c4c91d386a (patch)
tree6d4721bd0446586a6e8d7528edb3709ba8f2a054 /lib/libalpm/conflict.c
parent4c5bf09eec4835f8dfd300215f16289d106266d5 (diff)
downloadpacman-0c5dbdbfeca8a26d015230a8edd6d7c4c91d386a.tar.gz
pacman-0c5dbdbfeca8a26d015230a8edd6d7c4c91d386a.tar.xz
Alpm, check for NULL in free-functions
Also, use FREE() instead of free() in _alpm_backup_free() to set the pointers to NULL. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/conflict.c')
-rw-r--r--lib/libalpm/conflict.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index 0af3e3a8..41b8393c 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -68,6 +68,7 @@ error:
*/
void SYMEXPORT alpm_conflict_free(alpm_conflict_t *conflict)
{
+ ASSERT(conflict != NULL, return);
FREE(conflict->package2);
FREE(conflict->package1);
FREE(conflict);
@@ -301,6 +302,7 @@ error:
*/
void SYMEXPORT alpm_fileconflict_free(alpm_fileconflict_t *conflict)
{
+ ASSERT(conflict != NULL, return);
FREE(conflict->ctarget);
FREE(conflict->file);
FREE(conflict->target);