addons/51degrees/51d.c:922:4: warning: If memory allocation fails, then there 
is a possible null pointer dereference: _51d_property_list 
[nullPointerOutOfMemory]
---
 addons/51degrees/51d.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/addons/51degrees/51d.c b/addons/51degrees/51d.c
index 357aabc12..f50ce1ce3 100644
--- a/addons/51degrees/51d.c
+++ b/addons/51degrees/51d.c
@@ -925,6 +925,10 @@ static int init_51degrees(void)
                list_for_each_entry(name, &global_51degrees.property_names, 
list)
                        ++i;
                _51d_property_list = calloc(i, sizeof(*_51d_property_list));
+               if (!_51d_property_list) {
+                       ha_alert("51Degrees: Failed to allocate property 
list.\n");
+                       return (ERR_FATAL | ERR_ALERT);
+               }
 
                i = 0;
                list_for_each_entry(name, &global_51degrees.property_names, 
list)
-- 
2.46.0.windows.1



Reply via email to