[lxc-devel] [lxd/master] Don't access the returned struct in case of error

albertodonato on Github lxc-bot at linuxcontainers.org
Wed Jul 19 10:33:10 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170719/b016f52c/attachment.bin>
-------------- next part --------------
From 39892da0a4ea41ea9f47b6ba0e39a7b92297ab5c Mon Sep 17 00:00:00 2001
From: Alberto Donato <alberto.donato at canonical.com>
Date: Wed, 19 Jul 2017 12:32:37 +0200
Subject: [PATCH] Don't access the returned struct in case of error

Signed-off-by: Alberto Donato <alberto.donato at canonical.com>
---
 lxd/images.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/images.go b/lxd/images.go
index d764839ad..36a11d983 100644
--- a/lxd/images.go
+++ b/lxd/images.go
@@ -874,7 +874,7 @@ func autoUpdateImages(d *Daemon) {
 	for _, fingerprint := range images {
 		id, info, err := dbImageGet(d.db, fingerprint, false, true)
 		if err != nil {
-			logger.Error("Error loading image", log.Ctx{"err": err, "fp": info.Fingerprint})
+			logger.Error("Error loading image", log.Ctx{"err": err, "fp": fingerprint})
 			continue
 		}
 


More information about the lxc-devel mailing list