csa: Coverity (memory corruption, moderate)
authorJon Trulson <jon@radscan.com>
Fri, 26 Dec 2014 23:00:55 +0000 (16:00 -0700)
committerJon Trulson <jon@radscan.com>
Fri, 26 Dec 2014 23:00:55 +0000 (16:00 -0700)
cde/lib/csa/agent.c

index bbae64cbeb08f48b36ad9da10e47c0220ca62b97..ba5108e6831d5872140b4ef70f4391d20788e678 100644 (file)
@@ -481,11 +481,13 @@ _DtCm_handle_callback()
                                prev->next = ptr->next;
 
                        _FreeCallbackInfo(ptr);
+                        ptr = NULL; /* freed by _FreeCallbackInfo() */
 
                } else {
                        prev = ptr;
                }
-               ptr = ptr->next;
+                if (ptr)
+                  ptr = ptr->next;
        }
        cb_tail = prev;
 }