Skip to content

Commit

Permalink
rpc: fix leak reported by asan
Browse files Browse the repository at this point in the history
==5943==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 17276 byte(s) in 18 object(s) allocated from:
    #0 0x7fe4b07cfe60 in strdup (/lib64/libasan.so.5+0x3be60)
    gluster#1 0x497f5a in gbStrdup /root/gluster-block/utils/utils.c:461
    gluster#2 0x413858 in glusterBlockCallRPC_1 /root/gluster-block/rpc/block_svc_routines.c:615
    gluster#3 0x4180d6 in glusterBlockCreateRemote /root/gluster-block/rpc/block_svc_routines.c:960
    gluster#4 0x7fe4b076858d in start_thread (/lib64/libpthread.so.0+0x858d)

Direct leak of 396 byte(s) in 18 object(s) allocated from:
    #0 0x7fe4b0883c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    gluster#1 0x7fe4b04478c7 in _IO_vasprintf (/lib64/libc.so.6+0x7a8c7)

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0x7fe4b0883c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    gluster#1 0x7fe4b05a6bb9 in __rpc_uaddr2taddr_af (/lib64/libtirpc.so.3+0x13bb9)

SUMMARY: AddressSanitizer: 17704 byte(s) leaked in 38 allocation(s).

Signed-off-by: Prasanna Kumar Kalever <[email protected]>
Reviewed-by: Xiubo Li <[email protected]>
Reviewed-by: Amar Tumballi <[email protected]>
  • Loading branch information
Prasanna Kumar Kalever committed Apr 15, 2019
1 parent 2b68f9e commit 5999759
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rpc/block_svc_routines.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,9 @@ glusterBlockCreateRemoteAsync(blockServerDefPtr list,
}

out:
for (i = 0; i < mpath; i++) {
GB_FREE(args[i].reply);
}
GB_FREE(args);
GB_FREE(tid);

Expand Down

0 comments on commit 5999759

Please sign in to comment.