fix
authorMiklos Szeredi <miklos@szeredi.hu>
Thu, 19 Jan 2006 16:19:04 +0000 (16:19 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Thu, 19 Jan 2006 16:19:04 +0000 (16:19 +0000)
ChangeLog
lib/fuse_opt.c

index bdd1ec2a8446c5f8e4fcceb13bdb578b4ae00815..8d3723cb09fdeed953fd9ebdd5c0bb8391880556 100644 (file)
--- 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 <miklos@szeredi.hu>
 
        * kernel: fix detection of case when fuse is not configured into
index 5485e0a9d78a933054d927ab3b444b1368342d26..53511fcb7d8630326562f3ec1a4bf7a2eb7e3c38 100644 (file)
@@ -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;
 }