Fix a possible null pointer dereference
- This commit would fix a potential null pointer dereference.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: Ic323bde2c4bd35c35132e4310466cd6ae7ec7aeb
Signed-off-by: George Liu <liuxiwei@inspur.com>
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index 43e0de4..d595c2e 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -161,6 +161,7 @@
{
std::cerr << "Failed to get record by PDR type, ERROR:"
<< PLDM_PLATFORM_INVALID_EFFECTER_ID << std::endl;
+ return;
}
pdr->hdr.record_handle = 0;
pdr->hdr.version = 1;
@@ -211,6 +212,7 @@
{
std::cerr << "Failed to get record by PDR type, ERROR:"
<< PLDM_PLATFORM_INVALID_SENSOR_ID << std::endl;
+ return;
}
pdr->hdr.record_handle = 0;
pdr->hdr.version = 1;