summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-08-05 10:56:28 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2013-08-05 10:57:00 +0200
commit0a4ff4f53485c09b08606179c635d59abe75750a (patch)
treed9c580516f3e94d75e9709660d4a402f2e11629f /src
parent065427f417170795daf306f8a4b8efe4932a9e44 (diff)
downloadapk-tools-0a4ff4f53485c09b08606179c635d59abe75750a.tar.gz
apk-tools-0a4ff4f53485c09b08606179c635d59abe75750a.tar.bz2
apk-tools-0a4ff4f53485c09b08606179c635d59abe75750a.tar.xz
apk-tools-0a4ff4f53485c09b08606179c635d59abe75750a.zip
commit: fix segfault
apk would try run the trigger even if package failed to install.
Diffstat (limited to 'src')
-rw-r--r--src/commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commit.c b/src/commit.c
index 576224a..8766cc8 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -206,7 +206,7 @@ static void run_triggers(struct apk_database *db, struct apk_changeset *changese
if (pkg == NULL)
continue;
ipkg = pkg->ipkg;
- if (ipkg->pending_triggers->num == 0)
+ if (ipkg == NULL || ipkg->pending_triggers->num == 0)
continue;
*apk_string_array_add(&ipkg->pending_triggers) = NULL;