Memory leak is detected for each method invoke when using the SFCB local interface. Valgrind and code review shows the leak in the function invokeMethod when heap allocated class clone is not freed.
252,320 bytes in 5 blocks are definitely lost in loss record 57 of 57
at 0x40053C0: malloc (vg_replace_malloc.c:149)
by 0x558C01E: cls_clone (constClass.c:430)
by 0x5565F45: getClass (cimcClientSfcbLocal.c:1608)
by 0x55656A0: invokeMethod (cimcClientSfcbLocal.c:1447)
by 0x4156236: cim_invoke_method (sfcc-interface.c:2025)
The leak is significant on embedded environment. The proposed fix is attached for your review.
Log in to post a comment.