hooks: fail if allocating memory for send hooks fails
@@ -145,6 +145,13 @@ static int initHooksSendNotifications (KDB * kdb, const KeySet * config, KeySet
}
SendNotificationHook * hook = elektraMalloc (sizeof (SendNotificationHook));
+ if (hook == NULL)
+ {
+ ELEKTRA_ADD_INSTALLATION_WARNING (errorKey, "Could not allocate memory for SendNotificationHook");
+ elektraPluginClose (plugin, errorKey);
+ return -1;
+ }
+
hook->next = NULL;
hook->plugin = plugin;
hook->get = getPtr;
