[Spice-devel] [vdagent-linux 2/3] Remove unneeded NULL check

Christophe Fergeau cfergeau at redhat.com
Tue Sep 23 08:32:40 PDT 2014


Since previous commit, vdagent_x11_set_monitor_config() will return
early if 'curr' is NULL so we don't need to explicitly check its value.
Issue reported by the Coverity checker.
---
 src/vdagent-x11-randr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c
index f48f045..c332a40 100644
--- a/src/vdagent-x11-randr.c
+++ b/src/vdagent-x11-randr.c
@@ -795,7 +795,7 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
                          width_mm, height_mm);
         if (vdagent_x11_restore_error_handler(x11)) {
             syslog(LOG_ERR, "XRRSetScreenSize failed, not enough mem?");
-            if (!fallback && curr) {
+            if (!fallback) {
                 syslog(LOG_WARNING, "Restoring previous config");
                 vdagent_x11_set_monitor_config(x11, curr, 1);
                 free(curr);
-- 
1.9.3



More information about the Spice-devel mailing list