summaryrefslogtreecommitdiff
path: root/src/upgrade.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/upgrade.c')
-rw-r--r--src/upgrade.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/upgrade.c b/src/upgrade.c
index ff30c81..333035f 100644
--- a/src/upgrade.c
+++ b/src/upgrade.c
@@ -41,6 +41,9 @@ static int upgrade_main(void *ctx, int argc, char **argv)
return r;
state = apk_state_new(&db);
+ if (state == NULL)
+ goto err;
+
for (i = 0; i < db.world->num; i++) {
r = apk_state_lock_dependency(state, &db.world->item[i]);
if (r != 0) {