glusterfsd: fix the asan leak message

Fixes below trace of ASan:

Direct leak of 130 byte(s) in 1 object(s) allocated from:
    #0 0x7fa794bb5850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fa7944e5de9 in __gf_malloc ../../../libglusterfs/src/mem-pool.c:136
    #2 0x40b85c in gf_strndup ../../../libglusterfs/src/mem-pool.h:166
    #3 0x40b85c in gf_strdup ../../../libglusterfs/src/mem-pool.h:183
    #4 0x40b85c in parse_opts ../../../glusterfsd/src/glusterfsd.c:1049
    #5 0x7fa792a98720 in argp_parse (/lib64/libc.so.6+0x101720)
    #6 0x40d89f in parse_cmdline ../../../glusterfsd/src/glusterfsd.c:2041
    #7 0x406d07 in main ../../../glusterfsd/src/glusterfsd.c:2625


updates: bz#1633930
Change-Id: I394b3fc24b7a994c1b03635cb5e973e7290491d3
Signed-off-by: Amar Tumballi <amarts@redhat.com>
This commit is contained in:
Amar Tumballi 2018-10-08 19:22:53 +05:30
parent 46689e34b9
commit 0402a13914

View File

@ -2206,6 +2206,7 @@ glusterfs_pidfile_cleanup(glusterfs_ctx_t *ctx)
gf_msg_trace("glusterfsd", 0, "pidfile %s cleanup", cmd_args->pid_file);
if (ctx->cmd_args.pid_file) {
GF_FREE(ctx->cmd_args.pid_file);
ctx->cmd_args.pid_file = NULL;
}