From: Miklos Szeredi Date: Thu, 19 Jan 2006 16:19:04 +0000 (+0000) Subject: fix X-Git-Tag: fuse_2_5_2~8 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b786155f6581f876822c36b6d70ab3764a21e590;p=qemu-gpiodev%2Flibfuse.git fix --- diff --git a/ChangeLog b/ChangeLog index bdd1ec2..8d3723c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ needed by filesystems to implement some argument manipulations correctly + * fuse_opt: fix memory leak in handling "--" option + 2006-01-18 Miklos Szeredi * kernel: fix detection of case when fuse is not configured into diff --git a/lib/fuse_opt.c b/lib/fuse_opt.c index 5485e0a..53511fc 100644 --- a/lib/fuse_opt.c +++ b/lib/fuse_opt.c @@ -326,8 +326,10 @@ static int opt_parse(struct fuse_opt_context *ctx) fuse_opt_insert_arg(&ctx->outargs, 2, ctx->opts) == -1) return -1; } - if (ctx->nonopt && ctx->nonopt == ctx->outargs.argc) + if (ctx->nonopt && ctx->nonopt == ctx->outargs.argc) { + free(ctx->outargs.argv[ctx->outargs.argc - 1]); ctx->outargs.argv[--ctx->outargs.argc] = NULL; + } return 0; }