wangyunjian created THRIFT-5134: ----------------------------------- Summary: Fix memory leak when the handler method return FALSE Key: THRIFT-5134 URL: https://issues.apache.org/jira/browse/THRIFT-5134 Project: Thrift Issue Type: Bug Components: C glib - Compiler Affects Versions: 0.13.0 Reporter: wangyunjian Assignee: wangyunjian
The memory leak was triggered on calling the handler method with return FALSE. Because the return_value has been malloced when get property from the result_struct. The return_value need to be freed as necessary. Leak: Direct leak of 144 byte(s) in 2 object(s) allocated from: #0 0x7effd28b1ae8 in __interceptor_malloc (/usr/lib64/libasan.so.5+0xefae8) #1 0x7effd18e01d5 in g_malloc (/usr/lib64/libglib-2.0.so.0+0x531d5) #2 0x7effd18f7e06 in g_slice_alloc (/usr/lib64/libglib-2.0.so.0+0x6ae06) #3 0x7effd18f844c in g_slice_alloc0 (/usr/lib64/libglib-2.0.so.0+0x6b44c) #4 0x7effd234b849 in g_type_create_instance gtype.c:1848 #5 0x7effd232dfc7 in g_object_new_internal gobject.c:1799 #6 0x7effd232f714 in g_object_new_with_properties (/usr/lib64/libgobject-2.0.so.0+0x17714) #7 0x7effd23302d0 in g_object_new (/usr/lib64/libgobject-2.0.so.0+0x182d0) #8 0x496962 in t_test_thrift_test_test_multi_exception_result_instance_init gen-c_glib/t_test_thrift_test_types.c:21193 #9 0x7effd234b8e9 in g_type_create_instance gtype.c:1866 #10 0x7effd232dfc7 in g_object_new_internal gobject.c:1799 #11 0x7effd232f714 in g_object_new_with_properties (/usr/lib64/libgobject-2.0.so.0+0x17714) #12 0x7effd23302d0 in g_object_new (/usr/lib64/libgobject-2.0.so.0+0x182d0) #13 0x4331e9 in t_test_thrift_test_processor_process_test_multi_exception gen-c_glib/t_test_thrift_test.c:6978 #14 0x43412c in t_test_thrift_test_processor_dispatch_call gen-c_glib/t_test_thrift_test.c:7178 #15 0x7effd25832f0 in thrift_dispatch_processor_process src/thrift/c_glib/processor/thrift_dispatch_processor.c:56 #16 0x7effd25a77df in thrift_simple_server_serve src/thrift/c_glib/server/thrift_simple_server.c:58 #17 0x7effd25a6668 in thrift_server_serve src/thrift/c_glib/server/thrift_server.c:108 #18 0x409341 in main src/test_server.c:278 #19 0x7effd10c4872 in __libc_start_main (/usr/lib64/libc.so.6+0x23872) #20 0x404a1d in _start (/mnt/hgfs/share/thrift-0.13.0/test/c_glib/.libs/lt-test_server+0x404a1d) -- This message was sent by Atlassian Jira (v8.3.4#803005)