This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=9d180d6ea72d466b5af03ed5eadb4c2cc7345cab

commit 9d180d6ea72d466b5af03ed5eadb4c2cc7345cab
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Nov 6 02:50:48 2018 +0100

    dpkg: Initialize trigcyclenode's next member once
    
    Initialize the next member when we are allocating the struct.
---
 debian/changelog | 1 +
 src/trigproc.c   | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 2e883c3a6..525600048 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -78,6 +78,7 @@ dpkg (1.19.3) UNRELEASED; urgency=medium
     - update-alternatives: Use enums for actions instead of strings.
     - update-alternatives: Switch verbose selection into an enum.
     - dpkg: Negate tortoise_not_in_hare() function name and return value.
+    - dpkg: Initialize trigcyclenode's next member once.
   * Build system:
     - get-version: Use a format string with printf.
     - run-script: Use $() instead of deprecated ``.
diff --git a/src/trigproc.c b/src/trigproc.c
index 4f9de36ff..7cbf23c4a 100644
--- a/src/trigproc.c
+++ b/src/trigproc.c
@@ -266,6 +266,7 @@ check_trigger_cycle(struct pkginfo *processing_now)
 
        tcn = nfmalloc(sizeof(*tcn));
        tcn->pkgs = NULL;
+       tcn->next = NULL;
        tcn->then_processed = processing_now;
 
        iter = pkg_db_iter_new();
@@ -282,12 +283,10 @@ check_trigger_cycle(struct pkginfo *processing_now)
        if (!hare) {
                debug(dbg_triggersdetail, "check_triggers_cycle pnow=%s first",
                      pkg_name(processing_now, pnaw_always));
-               tcn->next = NULL;
                hare = tortoise = tcn;
                return NULL;
        }
 
-       tcn->next = NULL;
        hare->next = tcn;
        hare = tcn;
        if (tortoise_advance)

-- 
Dpkg.Org's dpkg

Reply via email to