Attn: Add some sanity checking for TI info pointer

Add some nullptr checks for TI info. An earlier commit should ensure
that this pointer is never null however during debug it proved useful
to verify this in a few places.

Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: Idae4a9dd22d61bbac5e76f0a79059efb69981e03
diff --git a/attn/attn_handler.cpp b/attn/attn_handler.cpp
index 34de90d..c41e231 100644
--- a/attn/attn_handler.cpp
+++ b/attn/attn_handler.cpp
@@ -241,6 +241,8 @@
     uint32_t tiInfoLen    = 0;                        // length of TI info data
     pdbg_target* attnProc = i_attention->getTarget(); // proc with attention
 
+    bool tiInfoStatic = false; // assume TI info was provided (not created)
+
     if (attnProc != nullptr)
     {
         // The processor PIB target is required for get TI info chipop
@@ -256,7 +258,8 @@
                 if (tiInfo == nullptr)
                 {
                     trace<level::INFO>("TI info data ptr is null after call");
-                    tiInfo = (uint8_t*)defaultPhypTiInfo;
+                    tiInfo       = (uint8_t*)defaultPhypTiInfo;
+                    tiInfoStatic = true; // using our TI info
                 }
             }
         }
@@ -345,7 +348,7 @@
     }
 
     // release TI data buffer
-    if (nullptr != tiInfo)
+    if ((nullptr != tiInfo) && (false == tiInfoStatic))
     {
         free(tiInfo);
     }