From b786155f6581f876822c36b6d70ab3764a21e590 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 19 Jan 2006 16:19:04 +0000 Subject: [PATCH] fix --- ChangeLog | 2 ++ lib/fuse_opt.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.30.2