debug: fix for a possible NULL dereferencing
debug: fix for a possible NULL dereferencing

Check results of allocations and list operations for NULL.

Signed-off-by: Vitaly Lubart <b0730d993d30ba92bb2c43417ba30474e8debbf3@intel.com>
Signed-off-by: Alexander Usyskin <2c2d03d7dae842f113743879f565d486184f22a3@intel.com>

Openwsman/openwsman,vcrhonek/openwsman,vcrhonek/openwsman,Openwsman/openwsman,vcrhonek/openwsman,vcrhonek/openwsman,Openwsman/openwsman,vcrhonek/openwsman,kkaempf/openwsman,Openwsman/openwsman,kkaempf/openwsman,Openwsman/openwsman,kkaempf/openwsman,kkaempf/openwsman,kkaempf/openwsman,vcrhonek/openwsman,kkaempf/openwsman,Openwsman/openwsman,vcrhonek/openwsman,Openwsman/openwsman,kkaempf/openwsman