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/deps.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 34ac8d39..f846b1ce 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -37,6 +37,7 @@ void SYMEXPORT alpm_dep_free(alpm_depend_t *dep) { + ASSERT(dep != NULL, return); FREE(dep->name); FREE(dep->version); FREE(dep->desc); @@ -63,6 +64,7 @@ error: void SYMEXPORT alpm_depmissing_free(alpm_depmissing_t *miss) { + ASSERT(miss != NULL, return); alpm_dep_free(miss->depend); FREE(miss->target); FREE(miss->causingpkg); -- cgit v1.2.3-24-g4f1b