agent: Improve error handling.
authorJustus Winter <justus@g10code.com>
Thu, 19 Nov 2015 15:18:20 +0000 (16:18 +0100)
committerJustus Winter <justus@g10code.com>
Thu, 19 Nov 2015 15:18:20 +0000 (16:18 +0100)
* agent/trustlist.c (istrusted_internal): Initialize 'err'.
--
There is a plausible path of execution so that a branch condition uses
the uninitialized value.

Found using the Clang Static Analyzer.

Signed-off-by: Justus Winter <justus@g10code.com>
agent/trustlist.c

index 175ebe4..af5f645 100644 (file)
@@ -398,7 +398,7 @@ static gpg_error_t
 istrusted_internal (ctrl_t ctrl, const char *fpr, int *r_disabled,
                     int already_locked)
 {
-  gpg_error_t err;
+  gpg_error_t err = 0;
   int locked = already_locked;
   trustitem_t *ti;
   size_t len;