Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.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 14:22:30 +1000
commit0c5dbdbfeca8a26d015230a8edd6d7c4c91d386a (patch)
tree6d4721bd0446586a6e8d7528edb3709ba8f2a054 /lib/libalpm/deps.c
parent4c5bf09eec4835f8dfd300215f16289d106266d5 (diff)
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/deps.c')
-rw-r--r--lib/libalpm/deps.c2
1 files changed, 2 insertions, 0 deletions
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);