From 0c5dbdbfeca8a26d015230a8edd6d7c4c91d386a Mon Sep 17 00:00:00 2001 From: Rikard Falkeborn Date: Sun, 25 Oct 2015 12:39:27 +0100 Subject: 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 Signed-off-by: Allan McRae --- lib/libalpm/conflict.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libalpm/conflict.c') 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); -- cgit v1.2.3-24-g4f1b