.......PS. [ZBX-8926] reverted previous changes and replaced json element retrieval with a function that allocates the necessary memory resources