From: Daniel Mack Date: Thu, 20 Feb 2014 12:29:54 +0000 (+0100) Subject: core/unit: fix unit_add_target_dependencies() for units with no dependencies X-Git-Tag: v210~122 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=db57f3c6d11864f4227bb6734a0d509695a32a7d;hp=6300b3eca9e5261b73bd7f1bb9735992b127cd80;p=elogind.git core/unit: fix unit_add_target_dependencies() for units with no dependencies For units without any dependencies, r needs to be initialized to 0. Otherwise, the return value of unit_add_target_dependencies() is unspecified. --- diff --git a/src/core/unit.c b/src/core/unit.c index 21ad434f9..016b1e3d8 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -959,7 +959,7 @@ static int unit_add_target_dependencies(Unit *u) { Unit *target; Iterator i; unsigned k; - int r; + int r = 0; assert(u);